Class LazyUtil.SafeLazy<T>

java.lang.Object
org.apache.logging.log4j.util.LazyUtil.SafeLazy<T>
All Implemented Interfaces:
Supplier<T>, Lazy<T>
Enclosing class:
LazyUtil

static class LazyUtil.SafeLazy<T> extends Object implements Lazy<T>
  • Field Details

    • lock

      private final Lock lock
    • supplier

      private final Supplier<T> supplier
    • value

      private volatile Object value
  • Constructor Details

  • Method Details

    • 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>
    • 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>
    • reset

      public void reset()
    • isInitialized

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

      public String toString()
      Overrides:
      toString in class Object