public class BaseTaggableObject extends 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 Map<String,com.google.protobuf.ByteString> |
tags |
| Constructor and Description |
|---|
BaseTaggableObject() |
| Modifier and Type | Method and Description |
|---|---|
com.google.protobuf.ByteString |
getTag(String tag)
Returns the immutable byte array associated with the given tag name, or throws
IllegalArgumentException
if that tag wasn't set yet. |
Map<String,com.google.protobuf.ByteString> |
getTags()
Returns a copy of all the tags held by this object.
|
com.google.protobuf.ByteString |
maybeGetTag(String tag)
Returns the immutable byte array associated with the given tag name, or null if there is none.
|
void |
setTag(String tag,
com.google.protobuf.ByteString value)
Associates the given immutable byte array with the string tag.
|
@Nullable public com.google.protobuf.ByteString maybeGetTag(String tag)
maybeGetTag in interface TaggableObjectpublic com.google.protobuf.ByteString getTag(String tag)
IllegalArgumentException
if that tag wasn't set yet.getTag in interface TaggableObjectpublic void setTag(String tag, com.google.protobuf.ByteString value)
setTag in interface TaggableObjectpublic Map<String,com.google.protobuf.ByteString> getTags()
getTags in interface TaggableObjectCopyright © 2015. All rights reserved.