public class AttributeStore extends Object implements ICastingAttributeStore
| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentMap<String,Object> |
attributes
Map for attributes
|
protected static org.slf4j.Logger |
log |
| Constructor and Description |
|---|
AttributeStore()
Creates empty attribute store.
|
AttributeStore(IAttributeStore values)
Creates attribute store with initial values.
|
AttributeStore(Map<String,Object> values)
Creates attribute store with initial values.
|
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,Object> |
filterNull(Map<String,Object> values)
Filter
|
static AttributeStore |
from(CompositeData cd)
Allows for reconstruction via CompositeData.
|
Object |
getAttribute(String name)
Return the value for a given attribute.
|
Object |
getAttribute(String name,
Object defaultValue)
Return the value for a given attribute and set it if it doesn't exist.
|
Set<String> |
getAttributeNames()
Get the attribute names.
|
Map<String,Object> |
getAttributes()
Get the attributes.
|
Boolean |
getBoolAttribute(String name)
Get Boolean attribute by name
|
Byte |
getByteAttribute(String name)
Get Byte attribute by name
|
Double |
getDoubleAttribute(String name)
Get Double attribute by name
|
Integer |
getIntAttribute(String name)
Get Integer attribute by name
|
List<?> |
getListAttribute(String name)
Get List attribute by name
|
Long |
getLongAttribute(String name)
Get boolean attribute by name
|
Map<?,?> |
getMapAttribute(String name)
Get Long attribute by name
|
Set<?> |
getSetAttribute(String name)
Get Set attribute by name
|
Short |
getShortAttribute(String name)
Get Short attribute by name
|
String |
getStringAttribute(String name)
Get String attribute by name
|
boolean |
hasAttribute(String name)
Check the object has an attribute.
|
boolean |
removeAttribute(String name)
Remove an attribute.
|
void |
removeAttributes()
Remove all attributes.
|
boolean |
setAttribute(String name,
Object value)
Set an attribute on this object.
|
boolean |
setAttributes(IAttributeStore values)
Set multiple attributes on this object.
|
boolean |
setAttributes(Map<String,Object> values)
Set multiple attributes on this object.
|
int |
size()
Size of the attribute store.
|
protected static org.slf4j.Logger log
protected ConcurrentMap<String,Object> attributes
public AttributeStore()
public AttributeStore(Map<String,Object> values)
values - mappublic AttributeStore(IAttributeStore values)
values - mapprotected Map<String,Object> filterNull(Map<String,Object> values)
nullkeys and values from given map.
values - the map to filterpublic Set<String> getAttributeNames()
getAttributeNames in interface IAttributeStoregetAttributeNames in interface AttributeStoreMXBeanpublic Map<String,Object> getAttributes()
getAttributes in interface IAttributeStorepublic Object getAttribute(String name)
getAttribute in interface IAttributeStorename - the name of the attribute to getpublic Object getAttribute(String name, Object defaultValue)
getAttribute in interface IAttributeStorename - the name of the attribute to getdefaultValue - the value of the attribute to set if the attribute doesn't existpublic boolean hasAttribute(String name)
hasAttribute in interface IAttributeStorehasAttribute in interface AttributeStoreMXBeanname - the name of the attribute to checkpublic boolean setAttribute(String name, Object value)
setAttribute in interface IAttributeStorename - the name of the attribute to changevalue - the new value of the attributepublic boolean setAttributes(Map<String,Object> values)
setAttributes in interface IAttributeStorevalues - the attributes to setpublic boolean setAttributes(IAttributeStore values)
setAttributes in interface IAttributeStorevalues - the attributes to setpublic boolean removeAttribute(String name)
removeAttribute in interface IAttributeStoreremoveAttribute in interface AttributeStoreMXBeanname - the name of the attribute to removepublic void removeAttributes()
removeAttributes in interface IAttributeStoreremoveAttributes in interface AttributeStoreMXBeanpublic int size()
size in interface IAttributeStorepublic Boolean getBoolAttribute(String name)
getBoolAttribute in interface ICastingAttributeStorename - Attribute namepublic Byte getByteAttribute(String name)
getByteAttribute in interface ICastingAttributeStorename - Attribute namepublic Double getDoubleAttribute(String name)
getDoubleAttribute in interface ICastingAttributeStorename - Attribute namepublic Integer getIntAttribute(String name)
getIntAttribute in interface ICastingAttributeStorename - Attribute namepublic List<?> getListAttribute(String name)
getListAttribute in interface ICastingAttributeStorename - Attribute namepublic Long getLongAttribute(String name)
getLongAttribute in interface ICastingAttributeStorename - Attribute namepublic Map<?,?> getMapAttribute(String name)
getMapAttribute in interface ICastingAttributeStorename - Attribute namepublic Set<?> getSetAttribute(String name)
getSetAttribute in interface ICastingAttributeStorename - Attribute namepublic Short getShortAttribute(String name)
getShortAttribute in interface ICastingAttributeStorename - Attribute namepublic String getStringAttribute(String name)
getStringAttribute in interface ICastingAttributeStorename - Attribute namepublic static AttributeStore from(CompositeData cd)
cd - composite dataCopyright © 2005–2017 Red5. All rights reserved.