BrightSide Workbench Full Report + Source Code
org.turro.contacts.organigram.RelationType Enum Reference

Public Member Functions

String getRelationKey ()
 
String getImage ()
 
int getGroup ()
 
int getLevel ()
 
Collection< RelationTypegetAllowedChildren ()
 
boolean isAllowed (RelationType rt)
 
boolean isThisType (BusinessRelation r)
 

Static Public Member Functions

static RelationType getFromString (String relation)
 
static String getRelationPrefix ()
 
static boolean matches (String relation)
 
static Collection< RelationTypegetAllowedTops ()
 

Public Attributes

 REL_HEADQUARTERS =(1, 1, true, "b_headquarters")
 
 REL_DEPARTMENT =(1, 2, true, "b_department")
 
 REL_MANAGEMENT =(1, 3, true, "management")
 
 REL_ADMINISTRATION =(1, 3, true, "documentation")
 
 REL_SALES =(1, 3, true, "sale")
 
 REL_PURCHASING =(1, 3, true, "cash")
 
 REL_TECHNICAL =(1, 3, true, "technology")
 
 REL_MAINTENANCE =(1, 3, true, "operator")
 
 REL_PRODUCTION =(1, 3, true, "service")
 
 REL_QUALITY =(1, 3, true, "qa")
 
 REL_HHRR =(1, 3, true, "contacts")
 
 REL_STAFF =(1, 3, true, "contact")
 
final int level
 

Detailed Description

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

Definition at line 31 of file RelationType.java.

Member Function Documentation

◆ getAllowedChildren()

Collection<RelationType> org.turro.contacts.organigram.RelationType.getAllowedChildren ( )

Definition at line 73 of file RelationType.java.

73  {
74  EnumSet<RelationType> srt = EnumSet.noneOf(RelationType.class);
75  for(RelationType rt : values()) {
76  if(isAllowed(rt)) {
77  srt.add(rt);
78  }
79  }
80  return srt;
81  }

◆ getAllowedTops()

static Collection<RelationType> org.turro.contacts.organigram.RelationType.getAllowedTops ( )
static

Definition at line 115 of file RelationType.java.

115  {
116  EnumSet<RelationType> srt = EnumSet.noneOf(RelationType.class);
117  for(RelationType rt : values()) {
118  if(rt.allowJumps) {
119  srt.add(rt);
120  } else if(rt.level == 1) {
121  srt.add(rt);
122  }
123  }
124  return srt;
125  }
Here is the caller graph for this function:

◆ getFromString()

static RelationType org.turro.contacts.organigram.RelationType.getFromString ( String  relation)
static

Definition at line 98 of file RelationType.java.

98  {
99  for(RelationType rt : values()) {
100  if(rt.getRelationKey().equals(relation)) {
101  return rt;
102  }
103  }
104  return null;
105  }
Here is the caller graph for this function:

◆ getGroup()

int org.turro.contacts.organigram.RelationType.getGroup ( )

Definition at line 65 of file RelationType.java.

65  {
66  return group;
67  }
Here is the caller graph for this function:

◆ getImage()

String org.turro.contacts.organigram.RelationType.getImage ( )

Definition at line 61 of file RelationType.java.

61  {
62  return Images.getImage(image);
63  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLevel()

int org.turro.contacts.organigram.RelationType.getLevel ( )

Definition at line 69 of file RelationType.java.

69  {
70  return level;
71  }
Here is the caller graph for this function:

◆ getRelationKey()

String org.turro.contacts.organigram.RelationType.getRelationKey ( )

Definition at line 57 of file RelationType.java.

57  {
58  return "$" + toString();
59  }
Here is the caller graph for this function:

◆ getRelationPrefix()

static String org.turro.contacts.organigram.RelationType.getRelationPrefix ( )
static

Definition at line 107 of file RelationType.java.

107  {
108  return "$REL_";
109  }

◆ isAllowed()

boolean org.turro.contacts.organigram.RelationType.isAllowed ( RelationType  rt)

Definition at line 83 of file RelationType.java.

83  {
84  if(rt != null && rt.group == group) {
85  if(allowJumps && rt.level > level) {
86  return true;
87  } else if(rt.level == (level + 1)) {
88  return true;
89  }
90  }
91  return false;
92  }

◆ isThisType()

boolean org.turro.contacts.organigram.RelationType.isThisType ( BusinessRelation  r)

Definition at line 94 of file RelationType.java.

94  {
95  return CompareUtil.compare(getRelationKey(), r.getRelationType()) == 0;
96  }
Here is the call graph for this function:

◆ matches()

static boolean org.turro.contacts.organigram.RelationType.matches ( String  relation)
static

Definition at line 111 of file RelationType.java.

111  {
112  return !Strings.isBlank(relation) && relation.startsWith(getRelationPrefix());
113  }
Here is the caller graph for this function:

Member Data Documentation

◆ level

final int org.turro.contacts.organigram.RelationType.level

Definition at line 46 of file RelationType.java.

◆ REL_ADMINISTRATION

org.turro.contacts.organigram.RelationType.REL_ADMINISTRATION =(1, 3, true, "documentation")

Definition at line 36 of file RelationType.java.

◆ REL_DEPARTMENT

org.turro.contacts.organigram.RelationType.REL_DEPARTMENT =(1, 2, true, "b_department")

Definition at line 34 of file RelationType.java.

◆ REL_HEADQUARTERS

org.turro.contacts.organigram.RelationType.REL_HEADQUARTERS =(1, 1, true, "b_headquarters")

Definition at line 33 of file RelationType.java.

◆ REL_HHRR

org.turro.contacts.organigram.RelationType.REL_HHRR =(1, 3, true, "contacts")

Definition at line 43 of file RelationType.java.

◆ REL_MAINTENANCE

org.turro.contacts.organigram.RelationType.REL_MAINTENANCE =(1, 3, true, "operator")

Definition at line 40 of file RelationType.java.

◆ REL_MANAGEMENT

org.turro.contacts.organigram.RelationType.REL_MANAGEMENT =(1, 3, true, "management")

Definition at line 35 of file RelationType.java.

◆ REL_PRODUCTION

org.turro.contacts.organigram.RelationType.REL_PRODUCTION =(1, 3, true, "service")

Definition at line 41 of file RelationType.java.

◆ REL_PURCHASING

org.turro.contacts.organigram.RelationType.REL_PURCHASING =(1, 3, true, "cash")

Definition at line 38 of file RelationType.java.

◆ REL_QUALITY

org.turro.contacts.organigram.RelationType.REL_QUALITY =(1, 3, true, "qa")

Definition at line 42 of file RelationType.java.

◆ REL_SALES

org.turro.contacts.organigram.RelationType.REL_SALES =(1, 3, true, "sale")

Definition at line 37 of file RelationType.java.

◆ REL_STAFF

org.turro.contacts.organigram.RelationType.REL_STAFF =(1, 3, true, "contact")

Definition at line 44 of file RelationType.java.

◆ REL_TECHNICAL

org.turro.contacts.organigram.RelationType.REL_TECHNICAL =(1, 3, true, "technology")

Definition at line 39 of file RelationType.java.


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