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

Public Member Functions

 Business (Contact contact)
 
Contact getBusiness ()
 
Contact getBusiness (Date date)
 
BusinessRelation getBusinessRelation ()
 
BusinessRelation getBusinessRelation (Date date)
 
List< ContactgetCompaniesList ()
 
List< ContactgetCentersList ()
 
List< ContactgetBusinessList ()
 
List< ContactgetBusinessList (Date date)
 
List< ContactgetOutdatedList ()
 
List< ContactgetOutdatedList (Date date)
 
List< ContactgetCoworkers ()
 
List< ContactgetCoworkers (Date date)
 

Detailed Description

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

Definition at line 39 of file Business.java.

Constructor & Destructor Documentation

◆ Business()

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

Definition at line 44 of file Business.java.

44  {
45  this.contact = contact;
46  this.now = new Date();
47  load();
48  }

Member Function Documentation

◆ getBusiness() [1/2]

Contact org.turro.contacts.relation.Business.getBusiness ( )

Definition at line 50 of file Business.java.

50  {
51  return getBusiness(now);
52  }

◆ getBusiness() [2/2]

Contact org.turro.contacts.relation.Business.getBusiness ( Date  date)

Definition at line 54 of file Business.java.

54  {
55  for(BusinessRelation br : this) {
56  if(br.isPreferential() && Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
57  return br.getBusiness();
58  }
59  }
60  for(IContactRelation cr : ContactRelations.getBusiness(contact.getId(), ContactRelations.MODE_OUTER)) {
61  if(cr.getStrong() && cr.asWorker()) {
62  return getDao().find(Contact.class, cr.getRelatedId());
63  }
64  }
65  for(BusinessRelation br : this) {
66  if(Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
67  return br.getBusiness();
68  }
69  }
70  return null;
71  }
Here is the call graph for this function:

◆ getBusinessList() [1/2]

List<Contact> org.turro.contacts.relation.Business.getBusinessList ( )

Definition at line 103 of file Business.java.

103  {
104  return getBusinessList(now);
105  }
Here is the caller graph for this function:

◆ getBusinessList() [2/2]

List<Contact> org.turro.contacts.relation.Business.getBusinessList ( Date  date)

Definition at line 107 of file Business.java.

107  {
108  ContactList cs = new ContactList();
109  for(BusinessRelation br : this) {
110  if(Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
111  cs.add(br.getBusiness());
112  }
113  }
114  return cs;
115  }
Here is the call graph for this function:

◆ getBusinessRelation() [1/2]

BusinessRelation org.turro.contacts.relation.Business.getBusinessRelation ( )

Definition at line 73 of file Business.java.

73  {
74  return getBusinessRelation(now);
75  }
BusinessRelation getBusinessRelation()
Definition: Business.java:73

◆ getBusinessRelation() [2/2]

BusinessRelation org.turro.contacts.relation.Business.getBusinessRelation ( Date  date)

Definition at line 77 of file Business.java.

77  {
78  for(BusinessRelation br : this) {
79  if(br.isPreferential() && Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
80  return br;
81  }
82  }
83  for(BusinessRelation br : this) {
84  if(Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
85  return br;
86  }
87  }
88  return null;
89  }
Here is the call graph for this function:

◆ getCentersList()

List<Contact> org.turro.contacts.relation.Business.getCentersList ( )

Definition at line 97 of file Business.java.

97  {
98  return getBusinessList().stream()
99  .filter(c -> ContactType.CONTACT_LEARNINGCENTER.equals(c.getType()))
100  .collect(Collectors.toList());
101  }
Here is the call graph for this function:

◆ getCompaniesList()

List<Contact> org.turro.contacts.relation.Business.getCompaniesList ( )

Definition at line 91 of file Business.java.

91  {
92  return getBusinessList().stream()
93  .filter(c -> ContactType.CONTACT_COMPANY.equals(c.getType()))
94  .collect(Collectors.toList());
95  }
Here is the call graph for this function:

◆ getCoworkers() [1/2]

List<Contact> org.turro.contacts.relation.Business.getCoworkers ( )

Definition at line 131 of file Business.java.

131  {
132  return getCoworkers(now);
133  }

◆ getCoworkers() [2/2]

List<Contact> org.turro.contacts.relation.Business.getCoworkers ( Date  date)

Definition at line 135 of file Business.java.

135  {
136  ContactList cs = new ContactList();
137  for(BusinessRelation br : this) {
138  Workers workers = new Workers(br.getBusiness());
139  cs.addAll(workers.getWorkers(date));
140  }
141  return cs;
142  }
Here is the call graph for this function:

◆ getOutdatedList() [1/2]

List<Contact> org.turro.contacts.relation.Business.getOutdatedList ( )

Definition at line 117 of file Business.java.

117  {
118  return getOutdatedList(now);
119  }

◆ getOutdatedList() [2/2]

List<Contact> org.turro.contacts.relation.Business.getOutdatedList ( Date  date)

Definition at line 121 of file Business.java.

121  {
122  ContactList cs = new ContactList();
123  for(BusinessRelation br : this) {
124  if(!Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
125  cs.add(br.getBusiness());
126  }
127  }
128  return cs;
129  }
Here is the call graph for this function:

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