Interface DefaultValue<S,​V>

    • Method Detail

      • of

        static <S,​V> DefaultValue<S,​V> of​(V def,
                                                      Value<S,​V> value)
        Creates a new DefaultValue by delegating to the provided arguments.
        Type Parameters:
        S - storage type
        V - value type
        Parameters:
        def - the default fallback value
        value - an existing value implementation
        Returns:
        a new instance composed of the arguments
      • setAsDefault

        default void setAsDefault​(S storage)
        Description copied from interface: DefaultSetter
        Sets the value in storage to the default value.
        Specified by:
        setAsDefault in interface DefaultSetter<S,​V>
        Parameters:
        storage - the storage
      • setAsDefaultIfUnset

        default void setAsDefaultIfUnset​(S storage)
        Description copied from interface: DefaultSetter
        Sets the value in storage to the default value if there isn't already an existing value yet.
        Specified by:
        setAsDefaultIfUnset in interface DefaultSetter<S,​V>
        Parameters:
        storage - the storage