Package aQute.bnd.service.tags
Class Tags
java.lang.Object
aQute.bnd.service.tags.Tags
A set of tags. A tag is a string-token which can be attached to an entity for
categorization and filtering. Typically these entities then implement the
Tagged interface.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends String> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleaninthashCode()booleanincludesAny(String... tags) booleanisEmpty()iterator()static Tagsstatic TagsParses a comma-separated string of tags into a Tags object.static StringHelper printing a csv-string of the tags for display purposes.booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Object[]toArray()<T> T[]toArray(T[] a) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
spliterator
-
Field Details
-
NO_TAGS
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<String>- Specified by:
containsAllin interfaceSet<String>
-
addAll
-
retainAll
-
removeAll
-
clear
public void clear() -
equals
-
hashCode
public int hashCode() -
toString
-
includesAny
- Parameters:
tags- (globs)- Returns:
trueif any of the given tags is included in the current set of tags, otherwise returnsfalse. Also if the current set of tags is empty, alsotrueis returned.
-
of
- Parameters:
name-- Returns:
- a Tags instance with the given tags.
-
parse
Parses a comma-separated string of tags into a Tags object.- Parameters:
csvTags-defaultTags- a default used when csvTags is null or blank- Returns:
- populated Tags or the passed defaultTags.
-
print
Helper printing a csv-string of the tags for display purposes. TheTagged.EMPTY_TAGSis treated specially.- Returns:
- a comma separated string of tags. If tags contains just 1 tag
which is
Tagged.EMPTY_TAGSthen "-" is returned. If there are more than 1 tags, thenTagged.EMPTY_TAGSis omitted.
-