19 package org.turro.interest;
21 import java.util.HashSet;
22 import java.util.List;
24 import org.turro.participation.ParticipationReason;
25 import org.turro.plugin.contacts.IContact;
26 import org.turro.reflection.Instances;
27 import org.turro.util.Arrays;
35 public void collect(Set<InterestCategory> categories) {
37 .filter(c -> !c.isReversed())
38 .map(c -> c.getReason())
40 if(!Arrays.isEmpty(normal))
collect(normal);
42 .filter(c -> c.isReversed())
43 .map(c -> c.getReason())
50 interests.addAll(collector.collect(contact, reasons));
57 interests.addAll(collector.reversed(contact, reasons));
63 return interests.stream().map(i -> i.getLabel()).distinct().sorted().toList();
66 public Set<Interest>
get() {
75 return interests.isEmpty();
85 private final Set<Interest> interests;
88 this.contact = contact;
89 this.interests =
new HashSet<>();
void collect(Set< InterestCategory > categories)
Set< Interest > collect(ParticipationReason... reasons)
static Interests from(IContact contact)
Set< Interest > reversed(ParticipationReason... reasons)