BrightSide Workbench Full Report + Source Code
org.turro.contacts.relation.Workers Class Reference
Inheritance diagram for org.turro.contacts.relation.Workers:
Collaboration diagram for org.turro.contacts.relation.Workers:

Public Member Functions

 Workers (Contact contact)
 
List< ContactgetWorkers ()
 
List< ContactgetWorkers (Date date)
 
boolean isWorker (Contact contact)
 
boolean isWorker (Contact contact, Date date)
 
boolean isByCondition (Contact contact, Predicate< BusinessRelation > predicate)
 
boolean isByCondition (Contact contact, Predicate< BusinessRelation > predicate, Date date)
 
List< ContactgetByCondition (Predicate< BusinessRelation > predicate)
 
List< ContactgetByCondition (Predicate< BusinessRelation > predicate, Date date)
 
List< BusinessRelationgetRelations (Contact contact)
 
List< BusinessRelationgetRelations (Contact contact, Date date)
 

Detailed Description

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

Definition at line 35 of file Workers.java.

Constructor & Destructor Documentation

◆ Workers()

org.turro.contacts.relation.Workers.Workers ( Contact  contact)

Definition at line 40 of file Workers.java.

40  {
41  this.contact = contact;
42  this.now = new Date();
43  load();
44  }

Member Function Documentation

◆ getByCondition() [1/2]

List<Contact> org.turro.contacts.relation.Workers.getByCondition ( Predicate< BusinessRelation predicate)

Definition at line 76 of file Workers.java.

76  {
77  return getByCondition(predicate, now);
78  }
List< Contact > getByCondition(Predicate< BusinessRelation > predicate)
Definition: Workers.java:76
Here is the caller graph for this function:

◆ getByCondition() [2/2]

List<Contact> org.turro.contacts.relation.Workers.getByCondition ( Predicate< BusinessRelation predicate,
Date  date 
)

Definition at line 80 of file Workers.java.

80  {
81  ContactList cs = new ContactList();
82  for(BusinessRelation br : this) {
83  if(predicate.test(br) && Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
84  cs.add(br.getContact());
85  }
86  }
87  return cs;
88  }
Here is the call graph for this function:

◆ getRelations() [1/2]

List<BusinessRelation> org.turro.contacts.relation.Workers.getRelations ( Contact  contact)

Definition at line 90 of file Workers.java.

90  {
91  return getRelations(contact, now);
92  }
List< BusinessRelation > getRelations(Contact contact)
Definition: Workers.java:90

◆ getRelations() [2/2]

List<BusinessRelation> org.turro.contacts.relation.Workers.getRelations ( Contact  contact,
Date  date 
)

Definition at line 94 of file Workers.java.

94  {
95  List<BusinessRelation> list = new ArrayList<>();
96  for(BusinessRelation br : this) {
97  if(Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
98  list.add(br);
99  }
100  }
101  return list;
102  }
Here is the call graph for this function:

◆ getWorkers() [1/2]

List<Contact> org.turro.contacts.relation.Workers.getWorkers ( )

Definition at line 46 of file Workers.java.

46  {
47  return getWorkers(now);
48  }
Here is the caller graph for this function:

◆ getWorkers() [2/2]

List<Contact> org.turro.contacts.relation.Workers.getWorkers ( Date  date)

Definition at line 50 of file Workers.java.

50  {
51  ContactList cs = new ContactList();
52  for(BusinessRelation br : this) {
53  if(Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
54  cs.add(br.getContact());
55  }
56  }
57  return cs;
58  }
Here is the call graph for this function:

◆ isByCondition() [1/2]

boolean org.turro.contacts.relation.Workers.isByCondition ( Contact  contact,
Predicate< BusinessRelation predicate 
)

Definition at line 68 of file Workers.java.

68  {
69  return contact != null && getByCondition(predicate).contains(contact);
70  }
Here is the call graph for this function:

◆ isByCondition() [2/2]

boolean org.turro.contacts.relation.Workers.isByCondition ( Contact  contact,
Predicate< BusinessRelation predicate,
Date  date 
)

Definition at line 72 of file Workers.java.

72  {
73  return contact != null && getByCondition(predicate, date).contains(contact);
74  }
Here is the call graph for this function:

◆ isWorker() [1/2]

boolean org.turro.contacts.relation.Workers.isWorker ( Contact  contact)

Definition at line 60 of file Workers.java.

60  {
61  return contact != null && getWorkers().contains(contact);
62  }
Here is the call graph for this function:

◆ isWorker() [2/2]

boolean org.turro.contacts.relation.Workers.isWorker ( Contact  contact,
Date  date 
)

Definition at line 64 of file Workers.java.

64  {
65  return contact != null && getWorkers(date).contains(contact);
66  }
Here is the call graph for this function:

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