public class BaseTaggableObject extends java.lang.Object implements TaggableObject
TaggableObject that just uses a lazily created hashmap that is
synchronized on this objects 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.
|
@Nullable protected java.util.Map<java.lang.String,com.google.protobuf.ByteString> tags
@Nullable public com.google.protobuf.ByteString maybeGetTag(java.lang.String tag)
TaggableObjectmaybeGetTag in interface TaggableObjectpublic com.google.protobuf.ByteString getTag(java.lang.String tag)
TaggableObjectIllegalArgumentException
if that tag wasn't set yet.getTag in interface TaggableObjectpublic void setTag(java.lang.String tag,
com.google.protobuf.ByteString value)
TaggableObjectsetTag in interface TaggableObjectpublic java.util.Map<java.lang.String,com.google.protobuf.ByteString> getTags()
TaggableObjectgetTags in interface TaggableObject