Interface DataHolder.Immutable<I extends DataHolder.Immutable<I>>

    • Method Detail

      • transform

        <E> java.util.Optional<I> transform​(Key<? extends Value<E>> key,
                                            java.util.function.Function<E,​E> function)
        Applies a transformation on the provided Value such that the return value of Function.apply(Object) will become the end resulting value set into the newly created DataHolder.Immutable.
        Type Parameters:
        E - The type of value
        Parameters:
        key - The key linked to
        function - The function to manipulate the value
        Returns:
        The newly created immutable value store
      • transform

        default <E> java.util.Optional<I> transform​(java.util.function.Supplier<? extends Key<? extends Value<E>>> key,
                                                    java.util.function.Function<E,​E> function)
        Applies a transformation on the provided Value such that the return value of Function.apply(Object) will become the end resulting value set into the newly created DataHolder.Immutable.
        Type Parameters:
        E - The type of value
        Parameters:
        key - The key linked to
        function - The function to manipulate the value
        Returns:
        The newly created immutable value store
      • with

        <E> java.util.Optional<I> with​(Key<? extends Value<E>> key,
                                       E value)
        Creates a new DataHolder.Immutable with the provided value by Key. If the key is supported by this value store, the returned value store will be present.
        Type Parameters:
        E - The type of value
        Parameters:
        key - The key to the value to set
        value - The value to set
        Returns:
        The new immutable value store
      • with

        default <E> java.util.Optional<I> with​(java.util.function.Supplier<? extends Key<? extends Value<E>>> key,
                                               E value)
        Creates a new DataHolder.Immutable with the provided value by Key. If the key is supported by this value store, the returned value store will be present.
        Type Parameters:
        E - The type of value
        Parameters:
        key - The key to the value to set
        value - The value to set
        Returns:
        The new immutable value store
      • with

        java.util.Optional<I> with​(Value<?> value)
        Offers the given value as defined by the provided Key such that if the Key is supported, a new DataHolder.Immutable is created.
        Parameters:
        value - The value to set
        Returns:
        The new immutable value store
      • without

        default java.util.Optional<I> without​(Value<?> value)
        Creates a new DataHolder.Immutable without the key of the provided Value. If the key is supported by this value store, the returned value store will be present.
        Parameters:
        value - The value
        Returns:
        The new immutable value store
      • without

        java.util.Optional<I> without​(Key<?> key)
        Creates a new DataHolder.Immutable without the provided Key. If the key is supported by this value store, the returned value store will be present.
        Parameters:
        key - The key to remove
        Returns:
        The new immutable value store
      • without

        default java.util.Optional<I> without​(java.util.function.Supplier<? extends Key<?>> key)
        Creates a new DataHolder.Immutable without the provided Key. If the key is supported by this value store, the returned value store will be present.
        Parameters:
        key - The key to remove
        Returns:
        The new immutable value store
      • mergeWith

        default I mergeWith​(I that)
        Attempts to merge the Value.Immutables from this DataHolder.Immutable and the given DataHolder.Immutable to produce a new instance of the merged result.
        Parameters:
        that - The other immutable value store to gather values from
        Returns:
        The new immutable value store instance