add method that returns a string representation of the tags in Tags
This commit is contained in:
@@ -225,4 +225,22 @@ public class Tags {
|
||||
return new Tags(filename);
|
||||
}
|
||||
|
||||
public String asString() {
|
||||
|
||||
final StringBuilder result = new StringBuilder();
|
||||
final SortedSet<Tag> tags = toTags();
|
||||
|
||||
for (final Tag tag : tags) {
|
||||
if (result.length() > 0) {
|
||||
result.append(", ");
|
||||
}
|
||||
|
||||
result.append(tag.getKey());
|
||||
result.append(":");
|
||||
result.append(tag.getValue());
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user