Package org.openjdk.jmc.common.util
Class StatefulState
- java.lang.Object
-
- org.openjdk.jmc.common.util.StatefulState
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StatefulState
create(IStateful state)
Create a new instance.String
getAttribute(String key)
Gets a named attribute value.String[]
getAttributeKeys()
Return an array with the attribute keys for this state.StatefulState
getChild(String type)
Gets a child of the named type.StatefulState[]
getChildren()
Gets all child nodes.StatefulState[]
getChildren(String type)
Gets all child nodes of a named type.String
getType()
Get the node type of this state.void
saveTo(IWritableState state)
Saves the state for this object into a state object.String
toString()
-
-
-
Method Detail
-
getType
public String getType()
Description copied from interface:IState
Get the node type of this state.
-
getChild
public StatefulState getChild(String type)
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
public String[] 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
public String getAttribute(String key)
Description copied from interface:IState
Gets a named attribute value.- Specified by:
getAttribute
in interfaceIState
- Parameters:
key
- attribute key- Returns:
- attribute value
-
getChildren
public StatefulState[] getChildren()
Description copied from interface:IState
Gets all child nodes.- Specified by:
getChildren
in interfaceIState
- Returns:
- an array of child nodes
-
getChildren
public StatefulState[] getChildren(String type)
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
public void saveTo(IWritableState state)
Description copied from interface:IStateful
Saves the state for this object into a state object.
-
create
public static StatefulState create(IStateful state)
Create a new instance.- Parameters:
state
- object whose state will be loaded into the new instance- Returns:
- a new state instance
-
-