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 TaggableObject
public com.google.protobuf.ByteString getTag(String tag)
IllegalArgumentException
if that tag wasn't set yet.getTag
in interface TaggableObject
public void setTag(String tag, com.google.protobuf.ByteString value)
setTag
in interface TaggableObject
public Map<String,com.google.protobuf.ByteString> getTags()
getTags
in interface TaggableObject
Copyright © 2014. All rights reserved.