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

Public Member Functions

String getId ()
 
void setId (String id)
 
String getDescription ()
 
void setDescription (String description)
 
String getRelationType ()
 
void setRelationType (String relationType)
 
boolean isPreferential ()
 
void setPreferential (boolean preferential)
 
boolean isValidated ()
 
void setValidated (boolean validated)
 
Contact getContact ()
 
void setContact (Contact contact)
 
Contact getBusiness ()
 
void setBusiness (Contact business)
 
Date getStartDate ()
 
void setStartDate (Date startDate)
 
Date getEndDate ()
 
void setEndDate (Date endDate)
 
Object entityId ()
 
boolean isEmpty ()
 
RelationType getType ()
 
boolean isTyped ()
 
boolean isResponsible ()
 
boolean isStudent ()
 
boolean isWorker ()
 
boolean isHHRR ()
 
ValidationStatus getStatus ()
 
String getFormattedDescription ()
 
String getDatesString ()
 
String getImage ()
 
String getRelated ()
 
void setRelated (String related)
 
int compareTo (BusinessRelation o)
 
- Public Member Functions inherited from org.turro.jpa.entity.IDaoEntity
default boolean isNew ()
 
default void prepareSave ()
 
default void prepareDelete ()
 
default void removeEmpties ()
 
default Collection< Collection > collections ()
 

Detailed Description

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

Definition at line 45 of file BusinessRelation.java.

Member Function Documentation

◆ compareTo()

int org.turro.contacts.BusinessRelation.compareTo ( BusinessRelation  o)

Definition at line 230 of file BusinessRelation.java.

230  {
231  int result = CompareUtil.compare(validated, o.validated);
232  if(result == 0) {
233  result = CompareUtil.compare(preferential, o.preferential);
234  }
235  if(result == 0) {
236  result = CompareUtil.compare(endDate, o.endDate);
237  }
238  if(result == 0) {
239  result = CompareUtil.compare(startDate, o.startDate);
240  }
241  if(result == 0) {
242  result = CompareUtil.compare(description, o.description);
243  }
244  if(result == 0) {
245  result = CompareUtil.compare(id, o.id);
246  }
247  return result;
248  }

◆ entityId()

Object org.turro.contacts.BusinessRelation.entityId ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 143 of file BusinessRelation.java.

143  {
144  return id;
145  }

◆ getBusiness()

Contact org.turro.contacts.BusinessRelation.getBusiness ( )

Definition at line 116 of file BusinessRelation.java.

116  {
117  return business;
118  }
Here is the caller graph for this function:

◆ getContact()

Contact org.turro.contacts.BusinessRelation.getContact ( )

Definition at line 108 of file BusinessRelation.java.

108  {
109  return contact;
110  }
Here is the caller graph for this function:

◆ getDatesString()

String org.turro.contacts.BusinessRelation.getDatesString ( )

Definition at line 198 of file BusinessRelation.java.

198  {
199  return PositionDates.format(startDate, endDate);
200  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDescription()

String org.turro.contacts.BusinessRelation.getDescription ( )

Definition at line 76 of file BusinessRelation.java.

76  {
77  return description;
78  }
Here is the caller graph for this function:

◆ getEndDate()

Date org.turro.contacts.BusinessRelation.getEndDate ( )

Definition at line 132 of file BusinessRelation.java.

132  {
133  return endDate;
134  }
Here is the caller graph for this function:

◆ getFormattedDescription()

String org.turro.contacts.BusinessRelation.getFormattedDescription ( )

Definition at line 185 of file BusinessRelation.java.

185  {
186  PhraseBuilder pb = new PhraseBuilder();
187  if(!Strings.isBlank(relationType)) {
188  pb.addWord(I_.byKey(relationType.substring(1)));
189  }
190  pb.addWord(description);
191  if(!pb.isBlank()) {
192  return pb.toString();
193  } else {
194  return "";
195  }
196  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getId()

String org.turro.contacts.BusinessRelation.getId ( )

Definition at line 68 of file BusinessRelation.java.

68  {
69  return id;
70  }
Here is the caller graph for this function:

◆ getImage()

String org.turro.contacts.BusinessRelation.getImage ( )

Definition at line 202 of file BusinessRelation.java.

202  {
203  if(!Strings.isBlank(relationType)) {
204  if(relationType.startsWith("$INT")) {
205  return Images.getImage("contract");
206  }
207  RelationType rt = RelationType.getFromString(relationType);
208  if(rt != null) {
209  return rt.getImage();
210  }
211  }
212  return null;
213  }
Here is the call graph for this function:

◆ getRelated()

String org.turro.contacts.BusinessRelation.getRelated ( )

Definition at line 219 of file BusinessRelation.java.

219  {
220  return related;
221  }

◆ getRelationType()

String org.turro.contacts.BusinessRelation.getRelationType ( )

Definition at line 84 of file BusinessRelation.java.

84  {
85  return relationType;
86  }
Here is the caller graph for this function:

◆ getStartDate()

Date org.turro.contacts.BusinessRelation.getStartDate ( )

Definition at line 124 of file BusinessRelation.java.

124  {
125  return startDate;
126  }
Here is the caller graph for this function:

◆ getStatus()

ValidationStatus org.turro.contacts.BusinessRelation.getStatus ( )

Definition at line 179 of file BusinessRelation.java.

179  {
180  return new ValidationStatus(this);
181  }
Here is the caller graph for this function:

◆ getType()

RelationType org.turro.contacts.BusinessRelation.getType ( )

Definition at line 155 of file BusinessRelation.java.

155  {
156  return RelationType.getFromString(relationType);
157  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmpty()

boolean org.turro.contacts.BusinessRelation.isEmpty ( )

Implements org.turro.jpa.entity.IDaoEntity.

Definition at line 148 of file BusinessRelation.java.

148  {
149  return (Strings.isEmpty(description) && Strings.isEmpty(relationType)) ||
150  contact == null || business == null;
151  }
Here is the caller graph for this function:

◆ isHHRR()

boolean org.turro.contacts.BusinessRelation.isHHRR ( )

Definition at line 175 of file BusinessRelation.java.

175  {
176  return FuzzyRelationTypes.isHHRR(this);
177  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isPreferential()

boolean org.turro.contacts.BusinessRelation.isPreferential ( )

Definition at line 92 of file BusinessRelation.java.

92  {
93  return preferential;
94  }
Here is the caller graph for this function:

◆ isResponsible()

boolean org.turro.contacts.BusinessRelation.isResponsible ( )

Definition at line 163 of file BusinessRelation.java.

163  {
164  return isTyped() && !RelationType.REL_STAFF.equals(getType());
165  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isStudent()

boolean org.turro.contacts.BusinessRelation.isStudent ( )

Definition at line 167 of file BusinessRelation.java.

167  {
168  return FuzzyRelationTypes.isStudent(this);
169  }
Here is the call graph for this function:

◆ isTyped()

boolean org.turro.contacts.BusinessRelation.isTyped ( )

Definition at line 159 of file BusinessRelation.java.

159  {
160  return !Strings.isBlank(relationType) && relationType.startsWith("$");
161  }
Here is the caller graph for this function:

◆ isValidated()

boolean org.turro.contacts.BusinessRelation.isValidated ( )

Definition at line 100 of file BusinessRelation.java.

100  {
101  return validated;
102  }
Here is the caller graph for this function:

◆ isWorker()

boolean org.turro.contacts.BusinessRelation.isWorker ( )

Definition at line 171 of file BusinessRelation.java.

171  {
172  return FuzzyRelationTypes.isWorker(this);
173  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBusiness()

void org.turro.contacts.BusinessRelation.setBusiness ( Contact  business)

Definition at line 120 of file BusinessRelation.java.

120  {
121  this.business = business;
122  }
Here is the caller graph for this function:

◆ setContact()

void org.turro.contacts.BusinessRelation.setContact ( Contact  contact)

Definition at line 112 of file BusinessRelation.java.

112  {
113  this.contact = contact;
114  }
Here is the caller graph for this function:

◆ setDescription()

void org.turro.contacts.BusinessRelation.setDescription ( String  description)

Definition at line 80 of file BusinessRelation.java.

80  {
81  this.description = description;
82  }
Here is the caller graph for this function:

◆ setEndDate()

void org.turro.contacts.BusinessRelation.setEndDate ( Date  endDate)

Definition at line 136 of file BusinessRelation.java.

136  {
137  this.endDate = endDate;
138  }
Here is the caller graph for this function:

◆ setId()

void org.turro.contacts.BusinessRelation.setId ( String  id)

Definition at line 72 of file BusinessRelation.java.

72  {
73  this.id = id;
74  }

◆ setPreferential()

void org.turro.contacts.BusinessRelation.setPreferential ( boolean  preferential)

Definition at line 96 of file BusinessRelation.java.

96  {
97  this.preferential = preferential;
98  }

◆ setRelated()

void org.turro.contacts.BusinessRelation.setRelated ( String  related)

Definition at line 223 of file BusinessRelation.java.

223  {
224  this.related = related;
225  }

◆ setRelationType()

void org.turro.contacts.BusinessRelation.setRelationType ( String  relationType)

Definition at line 88 of file BusinessRelation.java.

88  {
89  this.relationType = relationType;
90  }
Here is the caller graph for this function:

◆ setStartDate()

void org.turro.contacts.BusinessRelation.setStartDate ( Date  startDate)

Definition at line 128 of file BusinessRelation.java.

128  {
129  this.startDate = startDate;
130  }
Here is the caller graph for this function:

◆ setValidated()

void org.turro.contacts.BusinessRelation.setValidated ( boolean  validated)

Definition at line 104 of file BusinessRelation.java.

104  {
105  this.validated = validated;
106  }
Here is the caller graph for this function:

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