public class BaseTaggableObject extends java.lang.Object implements TaggableObject
TaggableObject
that uses a hashmap that is
synchronized on this object's Java monitor.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,com.google.protobuf.ByteString> |
tags |
Constructor and Description |
---|
BaseTaggableObject() |
Modifier and Type | Method and Description |
---|---|
com.google.protobuf.ByteString |
getTag(java.lang.String tag)
Returns the immutable byte array associated with the given tag name, or throws
IllegalArgumentException
if that tag wasn't set yet. |
java.util.Map<java.lang.String,com.google.protobuf.ByteString> |
getTags()
Returns a copy of all the tags held by this object.
|
com.google.protobuf.ByteString |
maybeGetTag(java.lang.String tag)
Returns the immutable byte array associated with the given tag name, or null if there is none.
|
void |
setTag(java.lang.String tag,
com.google.protobuf.ByteString value)
Associates the given immutable byte array with the string tag.
|
protected final java.util.Map<java.lang.String,com.google.protobuf.ByteString> tags
@Nullable public com.google.protobuf.ByteString maybeGetTag(java.lang.String tag)
TaggableObject
maybeGetTag
in interface TaggableObject
public com.google.protobuf.ByteString getTag(java.lang.String tag)
TaggableObject
IllegalArgumentException
if that tag wasn't set yet.getTag
in interface TaggableObject
public void setTag(java.lang.String tag, com.google.protobuf.ByteString value)
TaggableObject
setTag
in interface TaggableObject
public java.util.Map<java.lang.String,com.google.protobuf.ByteString> getTags()
TaggableObject
getTags
in interface TaggableObject