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

    • Method Detail

      • withElement

        I withElement​(E element)
        Creates a new CollectionValue.Immutable with the given values along with any pre-existing values within this value.
        Parameters:
        element - The element to add
        Returns:
        The new value
      • withAll

        I withAll​(java.lang.Iterable<E> elements)
        Creates a new CollectionValue.Immutable with the given elements along with any pre-existing values within this value.
        Parameters:
        elements - The elements to add
        Returns:
        The new value
        See Also:
        Collection.addAll(Collection)
      • without

        I without​(E element)
        Creates a new CollectionValue.Immutable without the given E element.
        Parameters:
        element - The element to exclude
        Returns:
        The new value
      • withoutAll

        I withoutAll​(java.lang.Iterable<E> elements)
        Creates a new CollectionValue.Immutable without the given elements of the provided Iterable.
        Parameters:
        elements - The elements to exclude
        Returns:
        The new value
      • withoutAll

        I withoutAll​(java.util.function.Predicate<E> predicate)
        Creates a new CollectionValue.Immutable with elements that when the given Predicate is Predicate.test(Object) on the element and true is returned, the element will remain in the new CollectionValue.Immutable.
        Parameters:
        predicate - The predicate to apply
        Returns:
        The new value
      • asImmutable

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