Interface KeySetter<S,​K,​V>

  • Type Parameters:
    S - storage type
    K - key type
    V - 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 void remove​(S storage, K key)
      Removes the value from the provided storage at the specified key.
      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's null.
    • 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's null.
        Parameters:
        storage - the storage
        key - the key
        updated - the value to set or null to remove
      • remove

        default void remove​(S storage,
                            K key)
        Removes the value from the provided storage at the specified key. This is equivalent to calling set(storage, key, value) with a null value.
        Parameters:
        storage - the storage
        key - the key