Class MutableValue

  • All Implemented Interfaces:

    
    public final class MutableValue<T extends Object>
    
                        

    Mutable value that tracks if it was modified.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      MutableValue(T initialValue)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Boolean isModified() Checks if the value is modified.
      final T get() Provides the current value.
      final Unit modify(Function1<T, T> block) Modifies the current value using block function.
      final Unit set(T value) Sets the current value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MutableValue

        MutableValue(T initialValue)
    • Method Detail

      • get

         final T get()

        Provides the current value.

      • modify

         final Unit modify(Function1<T, T> block)

        Modifies the current value using block function.

      • set

         final Unit set(T value)

        Sets the current value.