Class BooleanFuse

java.lang.Object
com.atlassian.confluence.util.BooleanFuse
All Implemented Interfaces:
BooleanSupplier, Supplier<Boolean>

public class BooleanFuse extends Object implements BooleanSupplier, Supplier<Boolean>
Wraps a boolean supplier to prevent the returned value from changing once 'tripped'.
Since:
9.0
  • Constructor Details

    • BooleanFuse

      public BooleanFuse(boolean initialState, Supplier<Boolean> realStateSupplier)
      Creates a BooleanFuse that wraps a boolean supplier to prevent the returned value from changing once 'tripped'.
      Parameters:
      initialState - the opposite of the desired tripped state, usually the initial state of the underlying call
      realStateSupplier - the call that returns the real state represented by this fuse
    • BooleanFuse

      public BooleanFuse(boolean initialState, BooleanSupplier realStateSupplier)
      Since:
      10.0
  • Method Details