Class LazyBoolean

  • All Implemented Interfaces:
    java.util.function.BooleanSupplier

    public class LazyBoolean
    extends java.lang.Object
    implements java.util.function.BooleanSupplier
    Since:
    2.22.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean initialized  
      private java.util.concurrent.locks.Lock lock  
      private java.util.function.BooleanSupplier supplier  
      private boolean value  
    • Constructor Summary

      Constructors 
      Constructor Description
      LazyBoolean​(java.util.function.BooleanSupplier supplier)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean getAsBoolean()  
      void reset()  
      void setAsBoolean​(boolean b)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • supplier

        private final java.util.function.BooleanSupplier supplier
      • lock

        private final java.util.concurrent.locks.Lock lock
      • initialized

        private volatile boolean initialized
      • value

        private volatile boolean value
    • Constructor Detail

      • LazyBoolean

        public LazyBoolean​(java.util.function.BooleanSupplier supplier)
    • Method Detail

      • getAsBoolean

        public boolean getAsBoolean()
        Specified by:
        getAsBoolean in interface java.util.function.BooleanSupplier
      • setAsBoolean

        public void setAsBoolean​(boolean b)
      • reset

        public void reset()