@Internal public final class ConcurrentAddressScopedStorage extends java.lang.Object implements AddressScopedStorage
Constructor and Description |
---|
ConcurrentAddressScopedStorage(java.util.List<StateValueContexts.StateValueContext<?>> stateValues) |
Modifier and Type | Method and Description |
---|---|
void |
addMutations(java.util.function.Consumer<FromFunction.PersistedValueMutation> consumer) |
<T> java.util.Optional<T> |
get(ValueSpec<T> valueSpec)
|
<T> void |
remove(ValueSpec<T> valueSpec)
|
<T> void |
set(ValueSpec<T> valueSpec,
T value)
|
public ConcurrentAddressScopedStorage(java.util.List<StateValueContexts.StateValueContext<?>> stateValues)
public <T> java.util.Optional<T> get(ValueSpec<T> valueSpec)
AddressScopedStorage
get
in interface AddressScopedStorage
T
- the type of the value.valueSpec
- the ValueSpec
to read the value for.Optional.empty()
if there was not prior value set.public <T> void set(ValueSpec<T> valueSpec, T value)
AddressScopedStorage
set
in interface AddressScopedStorage
T
- the type of the value.valueSpec
- the ValueSpec
to write the new value for.value
- the new value to set.public <T> void remove(ValueSpec<T> valueSpec)
AddressScopedStorage
ValueSpec
, scoped to the current invoked
Address
.
After removing the value, calling AddressScopedStorage.get(ValueSpec)
for the same spec will return an
Optional.empty()
.
remove
in interface AddressScopedStorage
T
- the type of the value.valueSpec
- the ValueSpec
to remove the prior value for.public void addMutations(java.util.function.Consumer<FromFunction.PersistedValueMutation> consumer)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.