Interface Assignment<V>

    • Method Detail

      • from

        static <V> Assignment<V> from​(AtomicReference<V> reference)
        Create a new Assignment which uses an AtomicReference to hold the assigned value.
        Parameters:
        reference - the holder of the assigned value
        Returns:
        the new Assignment using the given AtomicReference.
      • from

        static <V,​S> Assignment<V> from​(S container,
                                              Function<? super S,​V> getter,
                                              BiConsumer<? super S,​? super V> setter)
        Create a new Assignment, which assigns to and retrieves from an arbitrary container object.
        Parameters:
        container - The holder of the assigned value.
        getter - how the get the value from the container
        setter - how to set the value on the container
        Returns:
        the get and set operations as a new Assignment.
      • set

        void set​(V value)
        Assign the given value.
        Parameters:
        value - the value to assign.
      • accept

        default void accept​(V value)
        Specified by:
        accept in interface Consumer<V>