-
- Type Parameters:
S- storage typeV- value type
- All Known Subinterfaces:
AdaptedKeyValue<S,K,O,V>,AdaptedValue<S,O,V>,DefaultAdaptedKeyValue<S,K,O,V>,DefaultAdaptedValue<S,O,V>,DefaultKeyValue<S,K,V>,DefaultSetter<S,V>,DefaultValue<S,V>,KeyValue<S,K,V>,Value<S,V>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Setter<S,V>
Sets a value in storage.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidremove(S storage)Removes the value from the provided storage.voidset(S storage, @NullOr V updated)Sets the value within the provided storage to the input value or removes it if it'snull.
-
-
-
Method Detail
-
set
void set(S storage, @NullOr V updated)
Sets the value within the provided storage to the input value or removes it if it'snull.- Parameters:
storage- the storageupdated- the value to set ornullto remove
-
remove
default void remove(S storage)
Removes the value from the provided storage. This is equivalent to callingset(storage, value)with anullvalue.- Parameters:
storage- the storage
-
-