-
- Type Parameters:
S- storage typeK- key typeV- value type
- 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 KeySetter<S,K,V>
Sets a value in storage at a specified key.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidremove(S storage, K key)Removes the value from the provided storage at the specified key.voidset(S storage, K key, @NullOr V updated)Sets the value within the provided storage at the specified key to the input value or removes it if it'snull.
-
-
-
Method Detail
-
set
void set(S storage, K key, @NullOr V updated)
Sets the value within the provided storage at the specified key to the input value or removes it if it'snull.- Parameters:
storage- the storagekey- the keyupdated- the value to set ornullto remove
-
remove
default void remove(S storage, K key)
Removes the value from the provided storage at the specified key. This is equivalent to callingset(storage, key, value)with anullvalue.- Parameters:
storage- the storagekey- the key
-
-