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

Public Member Functions

String getFullRelation2 ()
 
String getFullRelation1 ()
 
String getId ()
 
String getOwner ()
 
void setOwner (String owner)
 
boolean isOnlyOwner ()
 
void setOnlyOwner (boolean onlyOwner)
 
String getDescription ()
 
void setDescription (String description)
 
org.turro.contacts.Contact getContact1 ()
 
void setContact1 (org.turro.contacts.Contact contact1)
 
org.turro.contacts.Contact getContact2 ()
 
void setContact2 (org.turro.contacts.Contact contact2)
 
String getRelated ()
 
void setRelated (String related)
 
String getRelationType ()
 
void setRelationType (String relationType)
 
boolean isPreferential ()
 
void setPreferential (boolean preferential)
 
boolean getCanShow (String userId)
 
boolean isEmpty ()
 
boolean isTyped ()
 
String getFormattedDescription ()
 
String getImage ()
 

Protected Member Functions

void setId (String id)
 

Detailed Description

Definition at line 31 of file Relation.java.

Member Function Documentation

◆ getCanShow()

boolean org.turro.contacts.Relation.getCanShow ( String  userId)

onlyOwner || owner.equals(userId);

Definition at line 144 of file Relation.java.

144  {
145  return true;
146  }

◆ getContact1()

org.turro.contacts.Contact org.turro.contacts.Relation.getContact1 ( )

Definition at line 104 of file Relation.java.

104  {
105  return contact1;
106  }
Here is the caller graph for this function:

◆ getContact2()

org.turro.contacts.Contact org.turro.contacts.Relation.getContact2 ( )

Definition at line 112 of file Relation.java.

112  {
113  return contact2;
114  }
Here is the caller graph for this function:

◆ getDescription()

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

Definition at line 96 of file Relation.java.

96  {
97  return description;
98  }

◆ getFormattedDescription()

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

Definition at line 159 of file Relation.java.

159  {
160  PhraseBuilder pb = new PhraseBuilder();
161  if(!Strings.isBlank(relationType)) {
162  pb.addWord(I_.byKey(relationType.substring(1)));
163  }
164  pb.addWord(description);
165  if(!pb.isBlank()) {
166  return pb.toString();
167  } else {
168  return "";
169  }
170  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFullRelation1()

String org.turro.contacts.Relation.getFullRelation1 ( )

Definition at line 65 of file Relation.java.

65  {
66  String result = "";
67  if(getFormattedDescription() != null) result += getFormattedDescription() + Chars.backward().spaced();
68  if(getContact1() != null) result += " " + getContact1().getName();
69  return result;
70  }
org.turro.contacts.Contact getContact1()
Definition: Relation.java:104
Here is the call graph for this function:

◆ getFullRelation2()

String org.turro.contacts.Relation.getFullRelation2 ( )

Definition at line 58 of file Relation.java.

58  {
59  String result = "";
60  if(getFormattedDescription() != null) result += getFormattedDescription() + Chars.forward().spaced();
61  if(getContact2() != null) result += " " + getContact2().getName();
62  return result;
63  }
org.turro.contacts.Contact getContact2()
Definition: Relation.java:112
Here is the call graph for this function:

◆ getId()

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

Definition at line 72 of file Relation.java.

72  {
73  return id;
74  }

◆ getImage()

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

Definition at line 172 of file Relation.java.

172  {
173  if(!Strings.isBlank(relationType)) {
174  if(relationType.startsWith("$INT")) {
175  return Images.getImage("contract");
176  }
177  RelationType rt = RelationType.getFromString(relationType);
178  if(rt != null) {
179  return rt.getImage();
180  }
181  }
182  return null;
183  }
Here is the call graph for this function:

◆ getOwner()

String org.turro.contacts.Relation.getOwner ( )

Definition at line 80 of file Relation.java.

80  {
81  return owner;
82  }

◆ getRelated()

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

Definition at line 120 of file Relation.java.

120  {
121  return related;
122  }

◆ getRelationType()

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

Definition at line 128 of file Relation.java.

128  {
129  return relationType;
130  }

◆ isEmpty()

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

Definition at line 148 of file Relation.java.

148  {
149  return (Strings.isEmpty(description) && Strings.isEmpty(relationType)) ||
150  contact1 == null || contact2 == null;
151  }

◆ isOnlyOwner()

boolean org.turro.contacts.Relation.isOnlyOwner ( )

Definition at line 88 of file Relation.java.

88  {
89  return onlyOwner;
90  }

◆ isPreferential()

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

Definition at line 136 of file Relation.java.

136  {
137  return preferential;
138  }

◆ isTyped()

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

Definition at line 155 of file Relation.java.

155  {
156  return !Strings.isBlank(relationType) && relationType.startsWith("$");
157  }

◆ setContact1()

void org.turro.contacts.Relation.setContact1 ( org.turro.contacts.Contact  contact1)

Definition at line 108 of file Relation.java.

108  {
109  this.contact1 = contact1;
110  }

◆ setContact2()

void org.turro.contacts.Relation.setContact2 ( org.turro.contacts.Contact  contact2)

Definition at line 116 of file Relation.java.

116  {
117  this.contact2 = contact2;
118  }

◆ setDescription()

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

Definition at line 100 of file Relation.java.

100  {
101  this.description = description;
102  }

◆ setId()

void org.turro.contacts.Relation.setId ( String  id)
protected

Definition at line 76 of file Relation.java.

76  {
77  this.id = id;
78  }

◆ setOnlyOwner()

void org.turro.contacts.Relation.setOnlyOwner ( boolean  onlyOwner)

Definition at line 92 of file Relation.java.

92  {
93  this.onlyOwner = onlyOwner;
94  }

◆ setOwner()

void org.turro.contacts.Relation.setOwner ( String  owner)

Definition at line 84 of file Relation.java.

84  {
85  this.owner = owner;
86  }

◆ setPreferential()

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

Definition at line 140 of file Relation.java.

140  {
141  this.preferential = preferential;
142  }

◆ setRelated()

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

Definition at line 124 of file Relation.java.

124  {
125  this.related = related;
126  }

◆ setRelationType()

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

Definition at line 132 of file Relation.java.

132  {
133  this.relationType = relationType;
134  }

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