Interface CollectionValue<E,​C extends Collection<E>>

    • Method Detail

      • size

        int size()
        Gets the size of the underlying collection of elements.
        Returns:
        The size
      • contains

        boolean contains​(E element)
        Checks if the given E element is contained within the backed Collection.
        Parameters:
        element - The element to check
        Returns:
        True if the element is contained in this collection
      • containsAll

        boolean containsAll​(Iterable<E> iterable)
        Checks if all of the given elements in the provided Iterable are contained within the backed Collection.
        Parameters:
        iterable - The iterable elements
        Returns:
        True if all elements are contained within the backed collection
      • all

        C all()
        Creates a new Collection of the proper type C with all elements copied to the new collection. Any modifications to the new collection are not reflected to this CollectionValue.Mutable. Likewise, no modifications to this CollectionValue.Mutable are reflected to the returned Collection.
        Returns:
        A new collection with all elements copied
      • asMutable

        CollectionValue.Mutable<E,​C,​?,​?> 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 Value<E>
        Returns:
        A mutable value
      • asMutableCopy

        CollectionValue.Mutable<E,​C,​?,​?> 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 Value<E>
        Returns:
        A mutable value
      • asImmutable

        CollectionValue.Immutable<E,​C,​?,​?> 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 Value<E>
        Returns:
        An immutable value