Class Ref<A>

  • Type Parameters:
    A - the type of the mutable value
    All Implemented Interfaces:
    Serializable

    public class Ref<A>
    extends Object
    implements Serializable
    Class for objects with a single mutable generic field.
    Author:
    Herbert Praehofer
    See Also:
    Serialized Form
    • Field Detail

      • value

        public A value
        The mutable field
    • Constructor Detail

      • Ref

        private Ref​(A value)
        Private constructor with the value for the mutable field.
        Parameters:
        value - the value for the mutable field
    • Method Detail

      • of

        public static <A> Ref<A> of​(A value)
        Creates an object with a mutable value.
        Type Parameters:
        A - the type of the mutable value
        Parameters:
        value - the initial value for the mutable field
        Returns:
        the object with the mutable field
      • toString

        public String toString()
        Returns a string representation.
        Overrides:
        toString in class Object
        Returns:
        string representation