|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IAttributeStore
Base interface for all API objects with attributes
Method Summary | |
---|---|
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 |
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. |
Method Detail |
---|
Set<String> getAttributeNames()
getAttributeNames
in interface AttributeStoreMXBean
Map<String,Object> getAttributes()
boolean setAttribute(String name, Object value)
name
- the name of the attribute to changevalue
- the new value of the attribute
boolean setAttributes(Map<String,Object> values)
values
- the attributes to set
boolean setAttributes(IAttributeStore values)
values
- the attributes to set
Object getAttribute(String name)
name
- the name of the attribute to get
Object getAttribute(String name, Object defaultValue)
This is a utility function that internally performs the following code:
if (!hasAttribute(name)) setAttribute(name, defaultValue);
return getAttribute(name);
name
- the name of the attribute to getdefaultValue
- the value of the attribute to set if the attribute doesn't
exist
boolean hasAttribute(String name)
hasAttribute
in interface AttributeStoreMXBean
name
- the name of the attribute to check
boolean removeAttribute(String name)
removeAttribute
in interface AttributeStoreMXBean
name
- the name of the attribute to remove
void removeAttributes()
removeAttributes
in interface AttributeStoreMXBean
int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |