Class MutableReference<T>

java.lang.Object
org.agrona.collections.MutableReference<T>
Type Parameters:
T - type of the reference.

public class MutableReference<T> extends Object
Mutable reference that is useful for capturing an object reference when using lambdas.
  • Field Details

    • ref

      public T ref
      For convenient access.
  • Constructor Details

    • MutableReference

      public MutableReference()
      Default constructor.
    • MutableReference

      public MutableReference(T ref)
      Set the reference at construction.
      Parameters:
      ref - to be set.
  • Method Details

    • get

      public T get()
      Get the current value of the reference.
      Returns:
      the current value of the reference.
    • set

      public void set(T ref)
      Set the current value of the reference.
      Parameters:
      ref - to be set.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object