BrightSide Workbench Full Report + Source Code
org.turro.interest.Interests Class Reference

Public Member Functions

void collect (Set< InterestCategory > categories)
 
Set< Interestcollect (ParticipationReason... reasons)
 
Set< Interestreversed (ParticipationReason... reasons)
 
List< String > labels ()
 
Set< Interestget ()
 
void clear ()
 
boolean isEmpty ()
 

Static Public Member Functions

static Interests from (IContact contact)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 33 of file Interests.java.

Member Function Documentation

◆ clear()

void org.turro.interest.Interests.clear ( )

Definition at line 70 of file Interests.java.

70  {
71  interests.clear();
72  }
Here is the caller graph for this function:

◆ collect() [1/2]

Set<Interest> org.turro.interest.Interests.collect ( ParticipationReason...  reasons)

Definition at line 48 of file Interests.java.

48  {
49  for(InterestCollector collector : Instances.fresh().byInterface(InterestCollector.class, InterestCollector.class)) {
50  interests.addAll(collector.collect(contact, reasons));
51  }
52  return interests;
53  }

◆ collect() [2/2]

void org.turro.interest.Interests.collect ( Set< InterestCategory categories)

Definition at line 35 of file Interests.java.

35  {
36  ParticipationReason[] normal = categories.stream()
37  .filter(c -> !c.isReversed())
38  .map(c -> c.getReason())
39  .toArray(ParticipationReason[]::new);
40  if(!Arrays.isEmpty(normal)) collect(normal);
41  ParticipationReason[] reversed = categories.stream()
42  .filter(c -> c.isReversed())
43  .map(c -> c.getReason())
44  .toArray(ParticipationReason[]::new);
45  if(!Arrays.isEmpty(reversed)) reversed(normal);
46  }
void collect(Set< InterestCategory > categories)
Definition: Interests.java:35
Set< Interest > reversed(ParticipationReason... reasons)
Definition: Interests.java:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from()

static Interests org.turro.interest.Interests.from ( IContact  contact)
static

Definition at line 80 of file Interests.java.

80  {
81  return new Interests(contact);
82  }

◆ get()

Set<Interest> org.turro.interest.Interests.get ( )

Definition at line 66 of file Interests.java.

66  {
67  return interests;
68  }
Here is the caller graph for this function:

◆ isEmpty()

boolean org.turro.interest.Interests.isEmpty ( )

Definition at line 74 of file Interests.java.

74  {
75  return interests.isEmpty();
76  }
Here is the caller graph for this function:

◆ labels()

List<String> org.turro.interest.Interests.labels ( )

Definition at line 62 of file Interests.java.

62  {
63  return interests.stream().map(i -> i.getLabel()).distinct().sorted().toList();
64  }
Here is the caller graph for this function:

◆ reversed()

Set<Interest> org.turro.interest.Interests.reversed ( ParticipationReason...  reasons)

Definition at line 55 of file Interests.java.

55  {
56  for(InterestCollector collector : Instances.fresh().byInterface(InterestCollector.class, InterestCollector.class)) {
57  interests.addAll(collector.reversed(contact, reasons));
58  }
59  return interests;
60  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: