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

Public Member Functions

 ProfileBusiness (Contact contact)
 
BusinessRelation getPrincipal ()
 
BusinessRelation getPrincipal (Date date)
 
List< BusinessRelationgetList ()
 
List< BusinessRelationgetList (Date date)
 
List< BusinessRelationgetOutdated ()
 
List< BusinessRelationgetOutdated (Date date)
 
List< BusinessRelationgetCoworkers ()
 
List< BusinessRelationgetCoworkers (Date date)
 

Detailed Description

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

Definition at line 34 of file ProfileBusiness.java.

Constructor & Destructor Documentation

◆ ProfileBusiness()

org.turro.contacts.profile.ProfileBusiness.ProfileBusiness ( Contact  contact)

Definition at line 39 of file ProfileBusiness.java.

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

Member Function Documentation

◆ getCoworkers() [1/2]

List<BusinessRelation> org.turro.contacts.profile.ProfileBusiness.getCoworkers ( )

Definition at line 91 of file ProfileBusiness.java.

91  {
92  return getCoworkers(now);
93  }

◆ getCoworkers() [2/2]

List<BusinessRelation> org.turro.contacts.profile.ProfileBusiness.getCoworkers ( Date  date)

Definition at line 95 of file ProfileBusiness.java.

95  {
96  List<BusinessRelation> brs = new ArrayList<>();
97  for(BusinessRelation br : this) {
98  Workers workers = new Workers(br.getBusiness());
99  brs.addAll(workers);
100  }
101  return brs;
102  }
Here is the call graph for this function:

◆ getList() [1/2]

List<BusinessRelation> org.turro.contacts.profile.ProfileBusiness.getList ( )

Definition at line 63 of file ProfileBusiness.java.

63  {
64  return getList(now);
65  }

◆ getList() [2/2]

List<BusinessRelation> org.turro.contacts.profile.ProfileBusiness.getList ( Date  date)

Definition at line 67 of file ProfileBusiness.java.

67  {
68  List<BusinessRelation> brs = new ArrayList<>();
69  for(BusinessRelation br : this) {
70  if(Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
71  brs.add(br);
72  }
73  }
74  return brs;
75  }
Here is the call graph for this function:

◆ getOutdated() [1/2]

List<BusinessRelation> org.turro.contacts.profile.ProfileBusiness.getOutdated ( )

Definition at line 77 of file ProfileBusiness.java.

77  {
78  return getOutdated(now);
79  }

◆ getOutdated() [2/2]

List<BusinessRelation> org.turro.contacts.profile.ProfileBusiness.getOutdated ( Date  date)

Definition at line 81 of file ProfileBusiness.java.

81  {
82  List<BusinessRelation> brs = new ArrayList<>();
83  for(BusinessRelation br : this) {
84  if(!Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
85  brs.add(br);
86  }
87  }
88  return brs;
89  }
Here is the call graph for this function:

◆ getPrincipal() [1/2]

BusinessRelation org.turro.contacts.profile.ProfileBusiness.getPrincipal ( )

Definition at line 45 of file ProfileBusiness.java.

45  {
46  return getPrincipal(now);
47  }

◆ getPrincipal() [2/2]

BusinessRelation org.turro.contacts.profile.ProfileBusiness.getPrincipal ( Date  date)

Definition at line 49 of file ProfileBusiness.java.

49  {
50  for(BusinessRelation br : this) {
51  if(br.isPreferential() && Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
52  return br;
53  }
54  }
55  for(BusinessRelation br : this) {
56  if(Dates.inRange(br.getStartDate(), br.getEndDate(), date)) {
57  return br;
58  }
59  }
60  return null;
61  }
Here is the call graph for this function:

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