18 package org.turro.vcard.properties;
20 import java.util.List;
21 import org.turro.string.Strings;
32 for(String l : lines) {
33 if(l.equalsIgnoreCase(
"VERSION:3.0")) {
43 this.version = version;
46 public void renderTypes(StringBuilder sb, List<String> types) {
47 if(types.isEmpty())
return;
49 for(String t : types) {
52 }
else if(version == 30) {
54 for(String t : types) {
61 sb.append(
"VERSION:");
64 }
else if(version == 30) {
70 public void readTypes(String s, List<String> types) {
71 if(Strings.isBlank(s))
return;
72 if(s.startsWith(
";")) s = s.substring(1);
74 for(String t : s.split(
";")) {
75 if(!Strings.isBlank(t)) types.add(t);
77 }
else if(version == 30) {
78 if(s.toUpperCase().startsWith(
"TYPE=")) {
80 for(String t : s.split(
",")) {
81 if(!Strings.isBlank(t)) types.add(t);
static Version getInstance(List< String > lines)
void renderVersion(StringBuilder sb)
void renderTypes(StringBuilder sb, List< String > types)
void readTypes(String s, List< String > types)