BrightSide Workbench Full Report + Source Code
org.turro.contacts.model.ModelSearch Class Reference

Public Member Functions

 ModelSearch ()
 
String getFieldContact ()
 
void setFieldContact (String fieldContact)
 
String getFieldRelation ()
 
void setFieldRelation (String fieldRelation)
 
String getFieldConnector ()
 
void setFieldConnector (String fieldConnector)
 
String getFieldAddress ()
 
void setFieldAddress (String fieldAddress)
 
String getFieldSyndication ()
 
void setFieldSyndication (String fieldSyndication)
 
String getFieldComment ()
 
void setFieldComment (String fieldComment)
 
boolean isUseConnector ()
 
void setUseConnector (boolean useConnector)
 
boolean isUseAddress ()
 
void setUseAddress (boolean useAddress)
 
boolean isUseComment ()
 
void setUseComment (boolean useComment)
 
void apply (String operator, String value, WhereClause wc, boolean stopIfEmpty)
 

Detailed Description

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

Definition at line 32 of file ModelSearch.java.

Constructor & Destructor Documentation

◆ ModelSearch()

org.turro.contacts.model.ModelSearch.ModelSearch ( )

Definition at line 37 of file ModelSearch.java.

37  {
38  this.fieldContact = "contact";
39  this.fieldRelation = "relation";
40  this.fieldConnector = "connector";
41  this.fieldAddress = "address";
42  this.fieldSyndication = "syndication";
43  this.fieldComment = "comment";
44  this.useConnector = false;
45  this.useAddress = false;
46  this.useComment = false;
47  }

Member Function Documentation

◆ apply()

void org.turro.contacts.model.ModelSearch.apply ( String  operator,
String  value,
WhereClause  wc,
boolean  stopIfEmpty 
)

Definition at line 121 of file ModelSearch.java.

121  {
122  if(Strings.isBlank(value)) {
123  wc.addClause(operator + (stopIfEmpty ? " 1=2" : " 1=1"));
124  } else if(value.indexOf("=") > 0) {
125  applyPair(operator, value, wc);
126  } else {
127  Set<String> fields = new HashSet<>();
128  fields.add("contact.name");
129  fields.add("contact.globalIdentifier");
130  if(useConnector) fields.add("connector.value");
131  if(useAddress) {
132  fields.add("address.city");
133  fields.add("address.zipCode");
134  fields.add("address.province");
135  fields.add("address.state");
136  fields.add("address.street");
137  }
138  if(useComment) fields.add("comment.comment");
139  wc.setPrefix(operator);
140  wc.addLikeFields(fields.toArray(new String[0]), value);
141  }
142  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFieldAddress()

String org.turro.contacts.model.ModelSearch.getFieldAddress ( )

Definition at line 73 of file ModelSearch.java.

73  {
74  return fieldAddress;
75  }

◆ getFieldComment()

String org.turro.contacts.model.ModelSearch.getFieldComment ( )

Definition at line 89 of file ModelSearch.java.

89  {
90  return fieldComment;
91  }

◆ getFieldConnector()

String org.turro.contacts.model.ModelSearch.getFieldConnector ( )

Definition at line 65 of file ModelSearch.java.

65  {
66  return fieldConnector;
67  }

◆ getFieldContact()

String org.turro.contacts.model.ModelSearch.getFieldContact ( )

Definition at line 49 of file ModelSearch.java.

49  {
50  return fieldContact;
51  }

◆ getFieldRelation()

String org.turro.contacts.model.ModelSearch.getFieldRelation ( )

Definition at line 57 of file ModelSearch.java.

57  {
58  return fieldRelation;
59  }

◆ getFieldSyndication()

String org.turro.contacts.model.ModelSearch.getFieldSyndication ( )

Definition at line 81 of file ModelSearch.java.

81  {
82  return fieldSyndication;
83  }

◆ isUseAddress()

boolean org.turro.contacts.model.ModelSearch.isUseAddress ( )

Definition at line 105 of file ModelSearch.java.

105  {
106  return useAddress;
107  }
Here is the caller graph for this function:

◆ isUseComment()

boolean org.turro.contacts.model.ModelSearch.isUseComment ( )

Definition at line 113 of file ModelSearch.java.

113  {
114  return useComment;
115  }
Here is the caller graph for this function:

◆ isUseConnector()

boolean org.turro.contacts.model.ModelSearch.isUseConnector ( )

Definition at line 97 of file ModelSearch.java.

97  {
98  return useConnector;
99  }
Here is the caller graph for this function:

◆ setFieldAddress()

void org.turro.contacts.model.ModelSearch.setFieldAddress ( String  fieldAddress)

Definition at line 77 of file ModelSearch.java.

77  {
78  this.fieldAddress = fieldAddress;
79  }

◆ setFieldComment()

void org.turro.contacts.model.ModelSearch.setFieldComment ( String  fieldComment)

Definition at line 93 of file ModelSearch.java.

93  {
94  this.fieldComment = fieldComment;
95  }

◆ setFieldConnector()

void org.turro.contacts.model.ModelSearch.setFieldConnector ( String  fieldConnector)

Definition at line 69 of file ModelSearch.java.

69  {
70  this.fieldConnector = fieldConnector;
71  }

◆ setFieldContact()

void org.turro.contacts.model.ModelSearch.setFieldContact ( String  fieldContact)

Definition at line 53 of file ModelSearch.java.

53  {
54  this.fieldContact = fieldContact;
55  }

◆ setFieldRelation()

void org.turro.contacts.model.ModelSearch.setFieldRelation ( String  fieldRelation)

Definition at line 61 of file ModelSearch.java.

61  {
62  this.fieldRelation = fieldRelation;
63  }

◆ setFieldSyndication()

void org.turro.contacts.model.ModelSearch.setFieldSyndication ( String  fieldSyndication)

Definition at line 85 of file ModelSearch.java.

85  {
86  this.fieldSyndication = fieldSyndication;
87  }

◆ setUseAddress()

void org.turro.contacts.model.ModelSearch.setUseAddress ( boolean  useAddress)

Definition at line 109 of file ModelSearch.java.

109  {
110  this.useAddress = useAddress;
111  }
Here is the caller graph for this function:

◆ setUseComment()

void org.turro.contacts.model.ModelSearch.setUseComment ( boolean  useComment)

Definition at line 117 of file ModelSearch.java.

117  {
118  this.useComment = useComment;
119  }
Here is the caller graph for this function:

◆ setUseConnector()

void org.turro.contacts.model.ModelSearch.setUseConnector ( boolean  useConnector)

Definition at line 101 of file ModelSearch.java.

101  {
102  this.useConnector = useConnector;
103  }
Here is the caller graph for this function:

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