Package org.openjdk.jmc.common.util
Class StatefulState
java.lang.Object
org.openjdk.jmc.common.util.StatefulState
Class used as a bridge between
IStateful and IState. You can read individual
values from it and you can pass the entire class to an IWritableState to save all the
values.
Instances of this class should be immutable.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StatefulStateCreate a new instance.getAttribute(String key) Gets a named attribute value.String[]Return an array with the attribute keys for this state.Gets a child of the named type.Gets all child nodes.getChildren(String type) Gets all child nodes of a named type.getType()Get the node type of this state.voidsaveTo(IWritableState state) Saves the state for this object into a state object.toString()
-
Method Details
-
getType
Description copied from interface:IStateGet the node type of this state. -
getChild
Description copied from interface:IStateGets a child of the named type. If there are several child nodes of the same type then any of them may be returned. -
getAttributeKeys
Description copied from interface:IStateReturn an array with the attribute keys for this state.- Specified by:
getAttributeKeysin interfaceIState- Returns:
- attribute keys
-
getAttribute
Description copied from interface:IStateGets a named attribute value.- Specified by:
getAttributein interfaceIState- Parameters:
key- attribute key- Returns:
- attribute value
-
getChildren
Description copied from interface:IStateGets all child nodes.- Specified by:
getChildrenin interfaceIState- Returns:
- an array of child nodes
-
getChildren
Description copied from interface:IStateGets all child nodes of a named type.- Specified by:
getChildrenin interfaceIState- Parameters:
type- node type- Returns:
- an array of child nodes
-
saveTo
Description copied from interface:IStatefulSaves the state for this object into a state object. -
create
Create a new instance.- Parameters:
state- object whose state will be loaded into the new instance- Returns:
- a new state instance
-
toString
-