Class LazyUtil.WeakConstant<T>

  • All Implemented Interfaces:
    java.util.function.Supplier<T>, Lazy<T>
    Enclosing class:
    LazyUtil

    static class LazyUtil.WeakConstant<T>
    extends java.lang.Object
    implements Lazy<T>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.ref.WeakReference<T> reference  
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isInitialized()
      Indicates whether this lazy value has been initialized.
      void set​(T newValue)
      Sets this lazy value to the provided value.
      java.lang.String toString()  
      T value()
      Returns the value held by this lazy.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.apache.logging.log4j.util.Lazy

        get, map
    • Field Detail

      • reference

        private final java.lang.ref.WeakReference<T> reference
    • Constructor Detail

      • WeakConstant

        WeakConstant​(T value)
    • Method Detail

      • value

        public T value()
        Description copied from interface: Lazy
        Returns the value held by this lazy. This may cause the value to initialize if it hasn't been already.
        Specified by:
        value in interface Lazy<T>
      • isInitialized

        public boolean isInitialized()
        Description copied from interface: Lazy
        Indicates whether this lazy value has been initialized.
        Specified by:
        isInitialized in interface Lazy<T>
      • set

        public void set​(T newValue)
        Description copied from interface: Lazy
        Sets this lazy value to the provided value.
        Specified by:
        set in interface Lazy<T>
      • toString

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