Class LocklessLazyVar<T>


  • public abstract class LocklessLazyVar<T>
    extends Object
    Implements the lazy initialization pattern. No locking of any kind is used.
    • Field Detail

      • NULL

        protected static final Object NULL
    • Constructor Detail

      • LocklessLazyVar

        public LocklessLazyVar()
    • Method Detail

      • get

        public T get()
        Returns:
        the value of this lazy var, created if necessary
      • set

        public T set​(T value)
      • init

        protected abstract T init()
      • clear

        public final T clear()
        Clears the variable, forcing the next call to get() to re-init the value.
      • isLoaded

        public boolean isLoaded()