Class MutableReference<T>

  • Type Parameters:
    T - type of the reference.

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

      Fields 
      Modifier and Type Field Description
      T ref
      For convenient access.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      T get()
      Get the current value of the reference.
      int hashCode()
      void set​(T ref)
      Set the current value of the reference.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • ref

        public T ref
        For convenient access.
    • Constructor Detail

      • MutableReference

        public MutableReference()
        Default constructor.
      • MutableReference

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

      • 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​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object