Package ca.uhn.fhir.model.api
Class TagList
- java.lang.Object
-
- ca.uhn.fhir.model.api.TagList
-
- All Implemented Interfaces:
Serializable,Iterable<Tag>,Collection<Tag>,Set<Tag>,IBase
public class TagList extends Object implements Set<Tag>, Serializable, IBase
A collection of tags present on a single resource. TagList is backed by aLinkedHashSet, so the order of added tags will be consistent, but duplicates will not be preserved.Thread safety: This class is not thread safe
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_CATEGORYstatic StringELEMENT_NAMEstatic StringELEMENT_NAME_LC
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(Tag theE)booleanaddAll(Collection<? extends Tag> theC)TagaddTag()Deprecated.Tags wil become immutable in a future release of HAPI, soaddTag(String, String, String)should be used insteadTagaddTag(String theScheme, String theTerm)Add a new tag instanceTagaddTag(String theScheme, String theTerm, String theLabel)Add a new tag instancevoidclear()booleancontains(Object theO)booleancontainsAll(Collection<?> theC)booleanequals(Object obj)Tagget(int theIndex)Returns the tag at a given index - Note that the TagList is backed by aLinkedHashSet, so the order of added tags will be consistent, but duplicates will not be preserved.List<String>getFormatCommentsPost()NOT SUPPORTED - ThrowsUnsupportedOperationExceptionList<String>getFormatCommentsPre()NOT SUPPORTED - ThrowsUnsupportedOperationExceptionTaggetTag(String theScheme, String theTerm)List<Tag>getTagsWithScheme(String theScheme)ObjectgetUserData(String theName)Retrieves any user suplied data in this elementbooleanhasFormatComment()Returns falseinthashCode()booleanisEmpty()Iterator<Tag>iterator()booleanremove(Object theO)booleanremoveAll(Collection<?> theC)booleanretainAll(Collection<?> theC)voidsetUserData(String theName, Object theValue)Sets a user supplied data value in this elementintsize()Object[]toArray()<T> T[]toArray(T[] theA)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
spliterator
-
-
-
-
Field Detail
-
ATTR_CATEGORY
public static final String ATTR_CATEGORY
- See Also:
- Constant Field Values
-
ELEMENT_NAME
public static final String ELEMENT_NAME
- See Also:
- Constant Field Values
-
ELEMENT_NAME_LC
public static final String ELEMENT_NAME_LC
-
-
Method Detail
-
addAll
public boolean addAll(Collection<? extends Tag> theC)
-
addTag
@Deprecated public Tag addTag()
Deprecated.Tags wil become immutable in a future release of HAPI, soaddTag(String, String, String)should be used instead
-
addTag
public Tag addTag(String theScheme, String theTerm)
Add a new tag instance- Parameters:
theScheme- The tag scheme (the system)theTerm- The tag term (the code)- Returns:
- Returns the newly created tag instance. Note that the tag is added to the list by this method, so you generally do not need to interact directly with the added tag.
-
addTag
public Tag addTag(String theScheme, String theTerm, String theLabel)
Add a new tag instance- Parameters:
theScheme- The tag schemetheTerm- The tag termtheLabel- The tag label- Returns:
- Returns the newly created tag instance. Note that the tag is added to the list by this method, so you generally do not need to interact directly with the added tag.
-
clear
public void clear()
-
containsAll
public boolean containsAll(Collection<?> theC)
- Specified by:
containsAllin interfaceCollection<Tag>- Specified by:
containsAllin interfaceSet<Tag>
-
get
public Tag get(int theIndex)
Returns the tag at a given index - Note that the TagList is backed by aLinkedHashSet, so the order of added tags will be consistent, but duplicates will not be preserved.
-
getTagsWithScheme
public List<Tag> getTagsWithScheme(String theScheme)
-
hashCode
public int hashCode()
-
isEmpty
public boolean isEmpty()
-
removeAll
public boolean removeAll(Collection<?> theC)
-
retainAll
public boolean retainAll(Collection<?> theC)
-
size
public int size()
-
toArray
public <T> T[] toArray(T[] theA)
-
hasFormatComment
public boolean hasFormatComment()
Returns false- Specified by:
hasFormatCommentin interfaceIBase
-
getFormatCommentsPre
public List<String> getFormatCommentsPre()
NOT SUPPORTED - ThrowsUnsupportedOperationException- Specified by:
getFormatCommentsPrein interfaceIBase
-
getFormatCommentsPost
public List<String> getFormatCommentsPost()
NOT SUPPORTED - ThrowsUnsupportedOperationException- Specified by:
getFormatCommentsPostin interfaceIBase
-
getUserData
public Object getUserData(String theName)
Description copied from interface:IBaseRetrieves any user suplied data in this element- Specified by:
getUserDatain interfaceIBase
-
setUserData
public void setUserData(String theName, Object theValue)
Description copied from interface:IBaseSets a user supplied data value in this element- Specified by:
setUserDatain interfaceIBase
-
-