Interface Value<E>

    • Method Detail

      • mutableOf

        static <E> Value.Mutable<E> mutableOf​(Key<? extends Value<E>> key,
                                              E element)
        Constructs a mutable Value 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> Value.Mutable<E> mutableOf​(java.util.function.Supplier<? extends Key<? extends Value<E>>> key,
                                              E element)
        Constructs a mutable Value 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> Value.Immutable<E> immutableOf​(Key<? extends Value<E>> key,
                                                  E element)
        Constructs an immutable Value 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> Value.Immutable<E> immutableOf​(java.util.function.Supplier<? extends Key<? extends Value<E>>> key,
                                                  E element)
        Constructs an immutable Value 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
      • mutableOf

        static <E> ListValue.Mutable<E> mutableOf​(Key<? extends ListValue<E>> key,
                                                  java.util.List<E> element)
        Constructs a mutable ListValue 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> ListValue.Mutable<E> mutableOf​(java.util.function.Supplier<? extends Key<? extends ListValue<E>>> key,
                                                  java.util.List<E> element)
        Constructs a mutable ListValue 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> ListValue.Immutable<E> immutableOf​(Key<? extends ListValue<E>> key,
                                                      java.util.List<E> element)
        Constructs an immutable ListValue 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> ListValue.Immutable<E> immutableOf​(java.util.function.Supplier<? extends Key<? extends ListValue<E>>> key,
                                                      java.util.List<E> element)
        Constructs an immutable ListValue 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
      • mutableOf

        static <E> SetValue.Mutable<E> mutableOf​(Key<? extends SetValue<E>> key,
                                                 java.util.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​(java.util.function.Supplier<? extends Key<? extends SetValue<E>>> key,
                                                 java.util.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,
                                                     java.util.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​(java.util.function.Supplier<? extends Key<? extends SetValue<E>>> key,
                                                     java.util.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
      • mutableOf

        static <K,​V> MapValue.Mutable<K,​V> mutableOf​(Key<? extends MapValue<K,​V>> key,
                                                                 java.util.Map<K,​V> element)
        Constructs a mutable MapValue of the appropriate type based on the given Key and the element.
        Type Parameters:
        K - The map key type
        V - The map value type
        Parameters:
        key - The key
        element - The element
        Returns:
        The constructed mutable value
      • mutableOf

        static <K,​V> MapValue.Mutable<K,​V> mutableOf​(java.util.function.Supplier<? extends Key<? extends MapValue<K,​V>>> key,
                                                                 java.util.Map<K,​V> element)
        Constructs a mutable MapValue of the appropriate type based on the given Key and the element.
        Type Parameters:
        K - The map key type
        V - The map value type
        Parameters:
        key - The key
        element - The element
        Returns:
        The constructed mutable value
      • immutableOf

        static <K,​V> MapValue.Immutable<K,​V> immutableOf​(Key<? extends MapValue<K,​V>> key,
                                                                     java.util.Map<K,​V> element)
        Constructs an immutable MapValue of the appropriate type based on the given Key and the element.
        Type Parameters:
        K - The map key type
        V - The map value type
        Parameters:
        key - The key
        element - The element
        Returns:
        The constructed immutable value
      • immutableOf

        static <K,​V> MapValue.Immutable<K,​V> immutableOf​(java.util.function.Supplier<? extends Key<? extends MapValue<K,​V>>> key,
                                                                     java.util.Map<K,​V> element)
        Constructs an immutable MapValue of the appropriate type based on the given Key and the element.
        Type Parameters:
        K - The map key type
        V - The map value type
        Parameters:
        key - The key
        element - The element
        Returns:
        The constructed immutable value
      • genericMutableOf

        static <V extends Value<E>,​E> V genericMutableOf​(Key<V> key,
                                                               E element)
        Constructs a Value of the appropriate type based on the given Key and the element. The returned Value is guaranteed Value.Mutable, this means that calling asMutable() will return itself.
        Type Parameters:
        V - The value type
        E - The element type
        Parameters:
        key - The key
        element - The element
        Returns:
        The constructed mutable value
      • genericImmutableOf

        static <V extends Value<E>,​E> V genericImmutableOf​(Key<V> key,
                                                                 E element)
        Constructs a Value of the appropriate type based on the given Key and the element. The returned Value is guaranteed Value.Immutable, this means that calling asImmutable() will return itself.
        Type Parameters:
        V - The value type
        E - The element type
        Parameters:
        key - The key
        element - The element
        Returns:
        The constructed immutable value
      • get

        E get()
        Gets the held value.
        Returns:
        The held value
      • key

        Key<? extends Value<E>> key()
        Gets the key for this Value.
        Returns:
        The key for this value
      • asMutable

        Value.Mutable<E> asMutable()
        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.
        Returns:
        A mutable value
      • asMutableCopy

        Value.Mutable<E> asMutableCopy()
        Retrieves a copy in the mutable form of this value. The new is created with the same key and values.
        Returns:
        A mutable value
      • asImmutable

        Value.Immutable<E> asImmutable()
        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.
        Returns:
        An immutable value