BrightSide Workbench Full Report + Source Code
org.turro.vcard.VCardToContact Class Reference

Public Member Functions

 VCardToContact (VCard vCard)
 
Contact getContact ()
 

Static Public Member Functions

static String translateGroup (List< String > types)
 
static boolean matchValue (String key, String defaultValue, List< String > types)
 
static String getMostUsedConnector (String key)
 
static String getMostUsedAddress (String key)
 

Detailed Description

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

Definition at line 32 of file VCardToContact.java.

Constructor & Destructor Documentation

◆ VCardToContact()

org.turro.vcard.VCardToContact.VCardToContact ( VCard  vCard)

Definition at line 37 of file VCardToContact.java.

37  {
38  this.vCard = vCard;
39  }

Member Function Documentation

◆ getContact()

Contact org.turro.vcard.VCardToContact.getContact ( )

Definition at line 41 of file VCardToContact.java.

41  {
42  if(contact == null) {
43  generateContact();
44  }
45  return contact;
46  }
Here is the caller graph for this function:

◆ getMostUsedAddress()

static String org.turro.vcard.VCardToContact.getMostUsedAddress ( String  key)
static

Definition at line 156 of file VCardToContact.java.

156  {
157  return MostUsed.getAddress(
158  ElephantProperties.getContextProperty("vCard", key, key),
159  key);
160  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMostUsedConnector()

static String org.turro.vcard.VCardToContact.getMostUsedConnector ( String  key)
static

Definition at line 150 of file VCardToContact.java.

150  {
151  return MostUsed.getConnector(
152  ElephantProperties.getContextProperty("vCard", key, key),
153  key);
154  }
Here is the call graph for this function:

◆ matchValue()

static boolean org.turro.vcard.VCardToContact.matchValue ( String  key,
String  defaultValue,
List< String >  types 
)
static

Definition at line 140 of file VCardToContact.java.

140  {
141  for(String p : types) {
142  if(ElephantProperties.getContextProperty("vCard", key, defaultValue).toLowerCase()
143  .matches(".*(,|^)" + p.toLowerCase() + "(,|$).*")) {
144  return true;
145  }
146  }
147  return false;
148  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ translateGroup()

static String org.turro.vcard.VCardToContact.translateGroup ( List< String >  types)
static

Definition at line 131 of file VCardToContact.java.

131  {
132  if(matchValue("Work", "Fiscal", types)) {
133  return getMostUsedAddress("Work");
134  } else if(matchValue("Home", "Postal", types)) {
135  return getMostUsedAddress("Home");
136  }
137  return types.isEmpty() ? "***" : types.get(0);
138  }
static String getMostUsedAddress(String key)
static boolean matchValue(String key, String defaultValue, List< String > types)
Here is the call graph for this function:

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