
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 String
ATTR_CATEGORY
static String
ELEMENT_NAME
static String
ELEMENT_NAME_LC
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
add(Tag theE)
boolean
addAll(Collection<? extends Tag> theC)
Tag
addTag()
Deprecated.Tags wil become immutable in a future release of HAPI, soaddTag(String, String, String)
should be used insteadTag
addTag(String theScheme, String theTerm)
Add a new tag instanceTag
addTag(String theScheme, String theTerm, String theLabel)
Add a new tag instancevoid
clear()
boolean
contains(Object theO)
boolean
containsAll(Collection<?> theC)
boolean
equals(Object obj)
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.List<String>
getFormatCommentsPost()
NOT SUPPORTED - ThrowsUnsupportedOperationException
List<String>
getFormatCommentsPre()
NOT SUPPORTED - ThrowsUnsupportedOperationException
Tag
getTag(String theScheme, String theTerm)
List<Tag>
getTagsWithScheme(String theScheme)
Object
getUserData(String theName)
Retrieves any user suplied data in this elementboolean
hasFormatComment()
Returns falseint
hashCode()
boolean
isEmpty()
Iterator<Tag>
iterator()
boolean
remove(Object theO)
boolean
removeAll(Collection<?> theC)
boolean
retainAll(Collection<?> theC)
void
setUserData(String theName, Object theValue)
Sets a user supplied data value in this elementint
size()
Object[]
toArray()
<T> T[]
toArray(T[] theA)
String
toString()
-
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:
containsAll
in interfaceCollection<Tag>
- Specified by:
containsAll
in 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:
hasFormatComment
in interfaceIBase
-
getFormatCommentsPre
public List<String> getFormatCommentsPre()
NOT SUPPORTED - ThrowsUnsupportedOperationException
- Specified by:
getFormatCommentsPre
in interfaceIBase
-
getFormatCommentsPost
public List<String> getFormatCommentsPost()
NOT SUPPORTED - ThrowsUnsupportedOperationException
- Specified by:
getFormatCommentsPost
in interfaceIBase
-
getUserData
public Object getUserData(String theName)
Description copied from interface:IBase
Retrieves any user suplied data in this element- Specified by:
getUserData
in interfaceIBase
-
setUserData
public void setUserData(String theName, Object theValue)
Description copied from interface:IBase
Sets a user supplied data value in this element- Specified by:
setUserData
in interfaceIBase
-
-