Package com.adobe.granite.ui.components
Class State
java.lang.Object
com.adobe.granite.ui.components.State
A key-value map of client-side state. A client may set a state such that the
server can retrieve it to do something specific about this client based on
the state.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the item value of the given name.booleanReturns the item value of the given name.intReturns the item value of the given name.Returns the item value of the given name.Returns the state item with the given name.names()Returns the available names.
-
Constructor Details
-
State
-
-
Method Details
-
get
Returns the item value of the given name. Returnsnullif the item is not found.- Parameters:
name- the name of the item- Returns:
- the item value as a string
-
get
Returns the item value of the given name. Returns the given defaultValue if the item is not found.- Parameters:
name- the name of the itemdefaultValue- the default value- Returns:
- the item value as a string or the default value if the item is not found
-
get
Returns the item value of the given name. Returns the given defaultValue if the item is not found, or the value is not a boolean string ("true" or "false").- Parameters:
name- the name of the itemdefaultValue- the default value- Returns:
- the item value as a boolean or the default value if the value is not a boolean string
-
get
Returns the item value of the given name. Returns the given defaultValue if the item is not found, or the value is not an integer string.- Parameters:
name- the name of the itemdefaultValue- the default value- Returns:
- the item value as an int or the default value if the value is not an int
-
names
Returns the available names.- Returns:
- the available names
-
getItem
Returns the state item with the given name. Returnsnullif the item is not found.- Parameters:
name- the name of the item- Returns:
- the state item
-