public class NopStateManager extends Object implements StateManager
Constructor and Description |
---|
NopStateManager() |
Modifier and Type | Method and Description |
---|---|
void |
clear(Scope scope)
Clears all keys and values from the component's state
|
StateMap |
getState(Scope scope)
Returns the current state for the component.
|
boolean |
replace(StateMap oldValue,
Map<String,String> newValue,
Scope scope)
Updates the value of the component's state to the new value if and only if the value currently
is the same as the given oldValue.
|
void |
setState(Map<String,String> state,
Scope scope)
Updates the value of the component's state, setting it to given value
|
public void setState(Map<String,String> state, Scope scope)
StateManager
setState
in interface StateManager
state
- the value to change the state toscope
- the scope to use when storing the statepublic StateMap getState(Scope scope)
StateManager
null
.
If the state has not yet been set, the StateMap's version will be -1, and the map of values will be empty.getState
in interface StateManager
scope
- the scope to use when fetching the statepublic boolean replace(StateMap oldValue, Map<String,String> newValue, Scope scope)
StateManager
replace
in interface StateManager
oldValue
- the old value to compare againstnewValue
- the new value to use if and only if the state's value is the same as the given oldValuescope
- the scope to use for storing the new statetrue
if the state was updated to the new value, false
if the state's value was not
equal to oldValuepublic void clear(Scope scope)
StateManager
clear
in interface StateManager
scope
- the scope whose values should be clearedCopyright © 2024 Apache NiFi Project. All rights reserved.