BrightSide Workbench Full Report + Source Code
org.turro.vcard.properties.Version Enum Reference

Public Member Functions

void renderTypes (StringBuilder sb, List< String > types)
 
void renderVersion (StringBuilder sb)
 
void readTypes (String s, List< String > types)
 

Static Public Member Functions

static Version getInstance (List< String > lines)
 

Public Attributes

 V21 =(21)
 
 V30 =(30)
 

Detailed Description

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

Definition at line 27 of file Version.java.

Member Function Documentation

◆ getInstance()

static Version org.turro.vcard.properties.Version.getInstance ( List< String >  lines)
static

Definition at line 31 of file Version.java.

31  {
32  for(String l : lines) {
33  if(l.equalsIgnoreCase("VERSION:3.0")) {
34  return V30;
35  }
36  }
37  return V21;
38  }

◆ readTypes()

void org.turro.vcard.properties.Version.readTypes ( String  s,
List< String >  types 
)

Definition at line 70 of file Version.java.

70  {
71  if(Strings.isBlank(s)) return;
72  if(s.startsWith(";")) s = s.substring(1);
73  if(version == 21) {
74  for(String t : s.split(";")) {
75  if(!Strings.isBlank(t)) types.add(t);
76  }
77  } else if(version == 30) {
78  if(s.toUpperCase().startsWith("TYPE=")) {
79  s = s.substring(5);
80  for(String t : s.split(",")) {
81  if(!Strings.isBlank(t)) types.add(t);
82  }
83  }
84  }
85  }
Here is the caller graph for this function:

◆ renderTypes()

void org.turro.vcard.properties.Version.renderTypes ( StringBuilder  sb,
List< String >  types 
)

Definition at line 46 of file Version.java.

46  {
47  if(types.isEmpty()) return;
48  if(version == 21) {
49  for(String t : types) {
50  sb.append(";" + t);
51  }
52  } else if(version == 30) {
53  sb.append("TYPE=");
54  for(String t : types) {
55  sb.append("," + t);
56  }
57  }
58  }
Here is the caller graph for this function:

◆ renderVersion()

void org.turro.vcard.properties.Version.renderVersion ( StringBuilder  sb)

Definition at line 60 of file Version.java.

60  {
61  sb.append("VERSION:");
62  if(version == 21) {
63  sb.append("2.1");
64  } else if(version == 30) {
65  sb.append("3.0");
66  }
67  sb.append("\n");
68  }
Here is the caller graph for this function:

Member Data Documentation

◆ V21

org.turro.vcard.properties.Version.V21 =(21)

Definition at line 29 of file Version.java.

◆ V30

org.turro.vcard.properties.Version.V30 =(30)

Definition at line 29 of file Version.java.


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