|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.red5.server.AttributeStore
public class AttributeStore
Field Summary | |
---|---|
protected ConcurrentMap<String,Object> |
attributes
Map for attributes |
protected static Logger |
log
|
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
protected Map<String,Object> |
filterNull(Map<String,Object> values)
Filter null keys and values from given map. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Logger log
protected ConcurrentMap<String,Object> attributes
Constructor Detail |
---|
public AttributeStore()
public AttributeStore(Map<String,Object> values)
values
- mappublic AttributeStore(IAttributeStore values)
values
- mapMethod Detail |
---|
protected Map<String,Object> filterNull(Map<String,Object> values)
null
keys and values from given map.
values
- the map to filter
public Set<String> getAttributeNames()
getAttributeNames
in interface IAttributeStore
getAttributeNames
in interface AttributeStoreMXBean
public Map<String,Object> getAttributes()
getAttributes
in interface IAttributeStore
public Object getAttribute(String name)
getAttribute
in interface IAttributeStore
name
- the name of the attribute to get
public Object getAttribute(String name, Object defaultValue)
getAttribute
in interface IAttributeStore
name
- the name of the attribute to getdefaultValue
- the value of the attribute to set if the attribute doesn't
exist
public boolean hasAttribute(String name)
hasAttribute
in interface IAttributeStore
hasAttribute
in interface AttributeStoreMXBean
name
- the name of the attribute to check
public boolean setAttribute(String name, Object value)
setAttribute
in interface IAttributeStore
name
- the name of the attribute to changevalue
- the new value of the attribute
public boolean setAttributes(Map<String,Object> values)
setAttributes
in interface IAttributeStore
values
- the attributes to set
public boolean setAttributes(IAttributeStore values)
setAttributes
in interface IAttributeStore
values
- the attributes to set
public boolean removeAttribute(String name)
removeAttribute
in interface IAttributeStore
removeAttribute
in interface AttributeStoreMXBean
name
- the name of the attribute to remove
public void removeAttributes()
removeAttributes
in interface IAttributeStore
removeAttributes
in interface AttributeStoreMXBean
public int size()
size
in interface IAttributeStore
public Boolean getBoolAttribute(String name)
getBoolAttribute
in interface ICastingAttributeStore
name
- Attribute name
public Byte getByteAttribute(String name)
getByteAttribute
in interface ICastingAttributeStore
name
- Attribute name
public Double getDoubleAttribute(String name)
getDoubleAttribute
in interface ICastingAttributeStore
name
- Attribute name
public Integer getIntAttribute(String name)
getIntAttribute
in interface ICastingAttributeStore
name
- Attribute name
public List<?> getListAttribute(String name)
getListAttribute
in interface ICastingAttributeStore
name
- Attribute name
public Long getLongAttribute(String name)
getLongAttribute
in interface ICastingAttributeStore
name
- Attribute name
public Map<?,?> getMapAttribute(String name)
getMapAttribute
in interface ICastingAttributeStore
name
- Attribute name
public Set<?> getSetAttribute(String name)
getSetAttribute
in interface ICastingAttributeStore
name
- Attribute name
public Short getShortAttribute(String name)
getShortAttribute
in interface ICastingAttributeStore
name
- Attribute name
public String getStringAttribute(String name)
getStringAttribute
in interface ICastingAttributeStore
name
- Attribute name
public static AttributeStore from(CompositeData cd)
cd
- composite data
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |