Interface CollectionValue.Mutable<E,​C extends java.util.Collection<E>,​M extends CollectionValue.Mutable<E,​C,​M,​I>,​I extends CollectionValue.Immutable<E,​C,​I,​M>>

    • Method Detail

      • add

        M add​(E element)
        Adds the given element to this CollectionValue.Mutable.
        Parameters:
        element - The element to add
        Returns:
        This value, for chaining
      • addAll

        M addAll​(java.lang.Iterable<E> elements)
        Adds all the given Iterable elements to the underlying Collection.
        Parameters:
        elements - The elements to add
        Returns:
        This value, for chaining
        See Also:
        Collection.addAll(Collection)
      • remove

        M remove​(E element)
        Removes the given element from the backed Collection.
        Parameters:
        element - The element to remove
        Returns:
        This value, for chaining
      • removeAll

        M removeAll​(java.lang.Iterable<E> elements)
        Removes all elements from the Iterable from the backed Collection.
        Parameters:
        elements - The elements to remove
        Returns:
        This value, for chaining
      • removeAll

        M removeAll​(java.util.function.Predicate<E> predicate)
        Iterates over all existing elements and removes any elements that Predicate.test(Object) returns true.
        Parameters:
        predicate - The predicate to remove elements
        Returns:
        This value, for chaining
      • set

        M set​(C value)
        Description copied from interface: Value.Mutable
        Sets the underlying value to the provided value.
        Specified by:
        set in interface Value.Mutable<E>
        Parameters:
        value - The value to set
        Returns:
        The owning ValueContainer
      • transform

        M transform​(java.util.function.Function<C,​C> function)
        Description copied from interface: Value.Mutable
        Attempts to transform the underlying value based on the provided Function such that the result of Function.apply(Object) will replace the underlying value.
        Specified by:
        transform in interface Value.Mutable<E>
        Parameters:
        function - The function to apply on the existing value
        Returns:
        The owning ValueContainer
      • copy

        M copy()
        Description copied from interface: Value.Mutable
        Makes an independent copy of this Value.Mutable with the same initial data. Both this value and the new value will refer to the same object initially.
        Specified by:
        copy in interface Value.Mutable<E>
        Returns:
        A new copy of this Value.Mutable
      • asMutableCopy

        default M asMutableCopy()
        Description copied from interface: Value
        Retrieves a copy in the mutable form of this value. The new is created with the same key and values.
        Specified by:
        asMutableCopy in interface CollectionValue<E,​C extends java.util.Collection<E>>
        Specified by:
        asMutableCopy in interface Value<E>
        Specified by:
        asMutableCopy in interface Value.Mutable<E>
        Returns:
        A mutable value
      • asMutable

        default M asMutable()
        Description copied from interface: Value
        Retrieves a mutable form of this value. Due to the vague nature of the value itself, some cases can already provide a Value.Mutable instance where this would simply return itself. In other cases, where the retrieved value is an Value.Immutable instance, a new mutable value is created with the same key and values.
        Specified by:
        asMutable in interface CollectionValue<E,​C extends java.util.Collection<E>>
        Specified by:
        asMutable in interface Value<E>
        Specified by:
        asMutable in interface Value.Mutable<E>
        Returns:
        A mutable value