Interface TransientStateHelper
-
- All Superinterfaces:
TransientStateHolder
public interface TransientStateHelper extends TransientStateHolder
Define a
Map-like contract that makes it easier for components to implementTransientStateHolder. EachUIComponentin the view will return an implementation of this interface from itsUIComponent.getTransientStateHelper()method.The values retrieved or saved through
getTransient(java.lang.Object)orputTransient(java.lang.Object, java.lang.Object)will not be preserved between requests.- Since:
- 2.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectgetTransient(Object key)Return the value currently associated with the specifiedkeyif any.ObjectgetTransient(Object key, Object defaultValue)Performs the same logic asgetTransient(java.lang.Object)} but if no value is found, this will return the specifieddefaultValueObjectputTransient(Object key, Object value)Return the previously stored value and store the specified key/value pair.-
Methods inherited from interface jakarta.faces.component.TransientStateHolder
restoreTransientState, saveTransientState
-
-
-
-
Method Detail
-
getTransient
Object getTransient(Object key)
Return the value currently associated with the specified
keyif any.- Parameters:
key- the key for which the value should be returned.- Returns:
- the stored value.
- Since:
- 2.1
-
getTransient
Object getTransient(Object key, Object defaultValue)
Performs the same logic as
getTransient(java.lang.Object)} but if no value is found, this will return the specifieddefaultValue- Parameters:
key- the key for which the value should be returned.defaultValue- the value to return if no value is found in the call toget().- Returns:
- the stored value.
- Since:
- 2.1
-
putTransient
Object putTransient(Object key, Object value)
Return the previously stored value and store the specified key/value pair. This is intended to store data that would otherwise reside in an instance variable on the component.
- Parameters:
key- the key for the valuevalue- the value- Returns:
- the previously stored value
- Since:
- 2.1
-
-