Interface SetValue<E>

All Superinterfaces:
CollectionValue<E,Set<E>>, Iterable<E>, Value<Set<E>>
All Known Subinterfaces:
SetValue.Immutable<E>, SetValue.Mutable<E>

public interface SetValue<E> extends CollectionValue<E,Set<E>>
  • Method Details

    • mutableOf

      static <E> SetValue.Mutable<E> mutableOf(Key<? extends SetValue<E>> key, Set<E> element)
      Constructs a mutable SetValue of the appropriate type based on the given Key and the element.
      Type Parameters:
      E - The element type
      Parameters:
      key - The key
      element - The element
      Returns:
      The constructed mutable value
    • mutableOf

      static <E> SetValue.Mutable<E> mutableOf(Supplier<? extends Key<? extends SetValue<E>>> key, Set<E> element)
      Constructs a mutable SetValue of the appropriate type based on the given Key and the element.
      Type Parameters:
      E - The element type
      Parameters:
      key - The key
      element - The element
      Returns:
      The constructed mutable value
    • immutableOf

      static <E> SetValue.Immutable<E> immutableOf(Key<? extends SetValue<E>> key, Set<E> element)
      Constructs an immutable SetValue of the appropriate type based on the given Key and the element.
      Type Parameters:
      E - The element type
      Parameters:
      key - The key
      element - The element
      Returns:
      The constructed immutable value
    • immutableOf

      static <E> SetValue.Immutable<E> immutableOf(Supplier<? extends Key<? extends SetValue<E>>> key, Set<E> element)
      Constructs an immutable SetValue of the appropriate type based on the given Key and the element.
      Type Parameters:
      E - The element type
      Parameters:
      key - The key
      element - The element
      Returns:
      The constructed immutable value
    • key

      Key<? extends SetValue<E>> key()
      Description copied from interface: Value
      Gets the key for this Value.
      Specified by:
      key in interface Value<E>
      Returns:
      The key for this value
    • asMutable

      SetValue.Mutable<E> 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,Set<E>>
      Specified by:
      asMutable in interface Value<E>
      Returns:
      A mutable value
    • asMutableCopy

      SetValue.Mutable<E> 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,Set<E>>
      Specified by:
      asMutableCopy in interface Value<E>
      Returns:
      A mutable value
    • asImmutable

      SetValue.Immutable<E> 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,Set<E>>
      Specified by:
      asImmutable in interface Value<E>
      Returns:
      An immutable value