Class Values.LazyUnsafeValueImpl<T,​E extends java.lang.Throwable>

  • All Implemented Interfaces:
    LazyUnsafeValue<T,​E>, UnsafeValue<T,​E>
    Enclosing class:
    Values

    private static class Values.LazyUnsafeValueImpl<T,​E extends java.lang.Throwable>
    extends java.lang.Object
    implements LazyUnsafeValue<T,​E>
    • Field Detail

      • lock

        private final java.lang.Object lock
      • delegate

        private final UnsafeValue<T,​E extends java.lang.Throwable> delegate
      • value

        private volatile UnsafeValue<T,​E extends java.lang.Throwable> value
    • Constructor Detail

      • LazyUnsafeValueImpl

        public LazyUnsafeValueImpl​(UnsafeValue<T,​E> delegate)
    • Method Detail

      • get

        public T get()
              throws E extends java.lang.Throwable
        Description copied from interface: UnsafeValue
        Get the stored value.
        Specified by:
        get in interface UnsafeValue<T,​E extends java.lang.Throwable>
        Returns:
        stored value.
        Throws:
        E - in case there was an error while computing the value.
        E extends java.lang.Throwable
      • isInitialized

        public boolean isInitialized()
        Description copied from interface: LazyUnsafeValue
        Check if the lazy value has been initialized already (i.e. its UnsafeValue.get() method has already been called previously) or not.
        Specified by:
        isInitialized in interface LazyUnsafeValue<T,​E extends java.lang.Throwable>
        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