Class Refs.ImmutableRefImpl<T>

  • All Implemented Interfaces:
    Ref<T>, Settable<T>, Value<T>
    Enclosing class:
    Refs

    private static final class Refs.ImmutableRefImpl<T>
    extends java.lang.Object
    implements Ref<T>
    Immutable Ref implementation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private T reference  
    • Constructor Summary

      Constructors 
      Constructor Description
      ImmutableRefImpl​(T value)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      T get()
      Get the stored value.
      int hashCode()  
      void set​(T value)
      Set a new value.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • reference

        private final T reference
    • Constructor Detail

      • ImmutableRefImpl

        ImmutableRefImpl​(T value)
    • Method Detail

      • get

        public T get()
        Description copied from interface: Value
        Get the stored value.
        Specified by:
        get in interface Value<T>
        Returns:
        stored value.
      • set

        public void set​(T value)
                 throws java.lang.IllegalStateException
        Description copied from interface: Settable
        Set a new value.
        Specified by:
        set in interface Settable<T>
        Parameters:
        value - value to be set.
        Throws:
        java.lang.IllegalStateException
      • toString

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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