@Test public void testEscape () { Tags ts = new Tags("d\\,ef,abc\\\\"); assertEquals("abc\\\\,d\\,ef", ts.toString()); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); for (String s : ts) { if (sb.length() > 0) sb.append(','); for (int i = 0; i<s.length(); i++) { char c = s.charAt(i); switch (c) { case '\\': case ',' : sb.append('\\'); break; } sb.append(c); } } return sb.toString(); }
Tags implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (String s : ts) { if (sb.length() > 0) sb.append(','); for (int i = 0; i<s.length(); i++) { char c = s.charAt(i); switch (c) { case '\\': case ',' : sb.append('\\'); break; } sb.append(c); } } return sb.toString(); } }
Tags implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (String s : ts) { if (sb.length() > 0) sb.append(','); for (int i = 0; i<s.length(); i++) { char c = s.charAt(i); switch (c) { case '\\': case ',' : sb.append('\\'); break; } sb.append(c); } } return sb.toString(); } Tags();  Tags(String tags);  Tags(String... tags); }
Tags implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (String s : ts) { if (sb.length() > 0) sb.append(','); for (int i = 0; i<s.length(); i++) { char c = s.charAt(i); switch (c) { case '\\': case ',' : sb.append('\\'); break; } sb.append(c); } } return sb.toString(); } Tags();  Tags(String tags);  Tags(String... tags); void setTags(String tags); boolean add(String t); boolean remove(String t); boolean contains(String t); Iterator<String> iterator(); int size(); boolean containsAll(Tags tags); boolean containsAny(Tags tags); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
Tags implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (String s : ts) { if (sb.length() > 0) sb.append(','); for (int i = 0; i<s.length(); i++) { char c = s.charAt(i); switch (c) { case '\\': case ',' : sb.append('\\'); break; } sb.append(c); } } return sb.toString(); } Tags();  Tags(String tags);  Tags(String... tags); void setTags(String tags); boolean add(String t); boolean remove(String t); boolean contains(String t); Iterator<String> iterator(); int size(); boolean containsAll(Tags tags); boolean containsAny(Tags tags); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }