Interface Getter<S,​V>

    • Method Detail

      • maybe

        static <S,​V> Getter<S,​V> maybe​(Function<S,​@NullOr V> getter)
        Converts a direct getter into an optional getter.
        Type Parameters:
        S - storage type
        V - value type
        Parameters:
        getter - direct getter
        Returns:
        the direct getter wrapped by an optional
      • get

        Optional<V> get​(S storage)
        Gets the possible value from storage.
        Parameters:
        storage - storage that may contain the value
        Returns:
        the value if it was successfully retrieved, otherwise empty