org.linkedin.glu.utils.tags
Interface WriteOnlyTaggeable

All Known Subinterfaces:
Taggeable
All Known Implementing Classes:
FilteredTaggeable, TaggeableHashSetImpl, TaggeableSetImpl, TaggeableTreeSetImpl

public interface WriteOnlyTaggeable

Defines an entity that is taggeable. A tag is just a string. A taggeable entity can have an unlimited number of tags.


Method Summary
 boolean addTag(java.lang.String tag)
          Adds a tag.
 java.util.Set<java.lang.String> addTags(java.util.Collection<java.lang.String> tags)
          Adds all the tags.
 boolean removeTag(java.lang.String tag)
          Removes the provided tag.
 java.util.Set<java.lang.String> removeTags(java.util.Collection<java.lang.String> tags)
          Removes all the tags.
 void setTags(java.util.Collection<java.lang.String> tags)
          Allow you to set the exact set of tags you want.
 

Method Detail

addTag

boolean addTag(java.lang.String tag)
Adds a tag.

Returns:
true if the tag which was added was a new tag, otherwise false

addTags

java.util.Set<java.lang.String> addTags(java.util.Collection<java.lang.String> tags)
Adds all the tags.

Returns:
the set of tags that were added (empty set if they were all already present)

removeTag

boolean removeTag(java.lang.String tag)
Removes the provided tag.

Returns:
true if the tag was removed or false if the tag was not present in the first place

removeTags

java.util.Set<java.lang.String> removeTags(java.util.Collection<java.lang.String> tags)
Removes all the tags.

Returns:
the set of tags that were not present (empty set if they were all already present)

setTags

void setTags(java.util.Collection<java.lang.String> tags)
Allow you to set the exact set of tags you want. Equivalent to calling (in an atomic fashion)
 removeTags(getTags())
 addTags(tags)
 

Parameters:
tags - tags to set