Class Values.LazyValueImpl<T>

  • All Implemented Interfaces:
    LazyValue<T>, Value<T>
    Enclosing class:
    Values

    private static class Values.LazyValueImpl<T>
    extends java.lang.Object
    implements LazyValue<T>
    • Constructor Summary

      Constructors 
      Constructor Description
      LazyValueImpl​(Value<T> delegate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      T get()
      Get the stored value.
      int hashCode()  
      boolean isInitialized()
      Check if the lazy value has been initialized already (i.e.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • lock

        private final java.lang.Object lock
      • delegate

        private final Value<T> delegate
      • value

        private volatile Value<T> value
    • Constructor Detail

      • LazyValueImpl

        public LazyValueImpl​(Value<T> delegate)
    • 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.
      • isInitialized

        public boolean isInitialized()
        Description copied from interface: LazyValue
        Check if the lazy value has been initialized already (i.e. its Value.get() method has already been called previously) or not.
        Specified by:
        isInitialized in interface LazyValue<T>
        Returns:
        true if the lazy value has already been initialized, false otherwise.
      • 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