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 StatefulState
Create 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.void
saveTo
(IWritableState state) Saves the state for this object into a state object.toString()
-
Method Details
-
getType
Description copied from interface:IState
Get the node type of this state. -
getChild
Description copied from interface:IState
Gets 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:IState
Return an array with the attribute keys for this state.- Specified by:
getAttributeKeys
in interfaceIState
- Returns:
- attribute keys
-
getAttribute
Description copied from interface:IState
Gets a named attribute value.- Specified by:
getAttribute
in interfaceIState
- Parameters:
key
- attribute key- Returns:
- attribute value
-
getChildren
Description copied from interface:IState
Gets all child nodes.- Specified by:
getChildren
in interfaceIState
- Returns:
- an array of child nodes
-
getChildren
Description copied from interface:IState
Gets all child nodes of a named type.- Specified by:
getChildren
in interfaceIState
- Parameters:
type
- node type- Returns:
- an array of child nodes
-
saveTo
Description copied from interface:IStateful
Saves 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
-