Interface Value.Immutable<E>

    • Method Detail

      • transform

        Value.Immutable<E> transform​(java.util.function.Function<E,​E> function)
        Retrieves the underlying value for this Value.Immutable and applies the given Function onto that value, after which, the product is sent to a new Value.Immutable replacing this one.

        If the ValueContainer too is immutable, a new instance of the ValueContainer may be created. If the ValueContainer is mutable, the same instance of the ValueContainer is retained.

        Parameters:
        function - The function to apply onto the existing value
        Returns:
        The owning ValueContainer, a new instance if it too is immutable
      • asMutableCopy

        default Value.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 Value<E>
        Returns:
        A mutable value
      • asImmutable

        default Value.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 Value<E>
        Returns:
        An immutable value