Interface AdaptedKeyValue<S,​K,​O,​V>

  • Type Parameters:
    S - storage type
    K - key type
    O - output type
    V - value type
    All Superinterfaces:
    Adaptable<O,​V>, Getter<S,​V>, KeyHolder<K>, KeyValue<S,​K,​V>, Setter<S,​V>, Value<S,​V>
    All Known Subinterfaces:
    DefaultAdaptedKeyValue<S,​K,​O,​V>

    public interface AdaptedKeyValue<S,​K,​O,​V>
    extends Adaptable<O,​V>, KeyValue<S,​K,​V>
    A value that's associated with a key and must be adapted to and from storage.
    • Method Summary

      Static Methods 
      Modifier and Type Method Description
      static <S,​K,​O,​V>
      AdaptedKeyValue<S,​K,​O,​V>
      of​(Adapter<O,​V> adapter, KeyValue<S,​K,​O> value)
      Creates a new AdaptedKeyValue by delegating to the provided arguments.
      • Methods inherited from interface com.rezzedup.util.valuables.Getter

        get
      • Methods inherited from interface com.rezzedup.util.valuables.KeyHolder

        key
      • Methods inherited from interface com.rezzedup.util.valuables.Setter

        remove, set
    • Method Detail

      • of

        static <S,​K,​O,​V> AdaptedKeyValue<S,​K,​O,​V> of​(Adapter<O,​V> adapter,
                                                                                         KeyValue<S,​K,​O> value)
        Creates a new AdaptedKeyValue by delegating to the provided arguments. Getting the value will always deserialize from storage, and setting the value will always serialize into storage.
        Type Parameters:
        S - storage type
        K - key type
        O - output type
        V - value type
        Parameters:
        adapter - the adapter
        value - an existing key value implementation that gets and sets the value from storage in the original 'output' type
        Returns:
        a new instance composed of the arguments