public class State extends Object
Constructor and Description |
---|
State(StateHelper stateHelper) |
Modifier and Type | Method and Description |
---|---|
<T> T |
get(Serializable key)
Attempts to find a value associated with the specified key in the component's state.
|
<T> T |
get(Serializable key,
Object defaultValue)
Attempts to find a value associated with the specified key in the component's state.
|
<T> T |
put(Serializable key,
T value)
Puts a value in the component's state and returns the previous value.
|
public State(StateHelper stateHelper)
public <T> T get(Serializable key)
T
- The expected return type.key
- the name of the value in component's stateClassCastException
- When T
is of wrong type.public <T> T get(Serializable key, Object defaultValue)
T
- The expected return type.key
- the name of the value in component's statedefaultValue
- the value to return if no value is found in the call to get()ClassCastException
- When T
is of wrong type.public <T> T put(Serializable key, T value)
T
- The expected value and return type.key
- The name of the value in component's state.value
- The value to put in component's state.ClassCastException
- When T
is of wrong type.Copyright © 2012–2020 OmniFaces. All rights reserved.