Class Reference<T>

java.lang.Object
dev.engine.core.versioned.Reference<T>

public class Reference<T> extends Object
Tracks staleness relative to a Versioned container. Call update() to check if the value changed since the last call. Multiple references to the same Versioned track independently.
  • Method Details

    • update

      public boolean update()
      Returns true if the value changed since the last call to update(). Caches the current value internally.
    • getValue

      public T getValue()
      Returns the cached value from the last update() call.
    • set

      public void set(T value)
      Writes a value back through to the underlying Versioned container.
    • reference

      public Reference<T> reference()
      Creates a new independent reference to the same Versioned container.