Package com.atlassian.confluence.util
Class BooleanFuse
java.lang.Object
com.atlassian.confluence.util.BooleanFuse
- All Implemented Interfaces:
BooleanSupplier
,Supplier<Boolean>
Wraps a boolean supplier to prevent the returned value from changing once 'tripped'.
- Since:
- 9.0
-
Constructor Summary
ConstructorsConstructorDescriptionBooleanFuse
(boolean initialState, BooleanSupplier realStateSupplier) BooleanFuse
(boolean initialState, Supplier<Boolean> realStateSupplier) Creates a BooleanFuse that wraps a boolean supplier to prevent the returned value from changing once 'tripped'. -
Method Summary
-
Constructor Details
-
BooleanFuse
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 callrealStateSupplier
- the call that returns the real state represented by this fuse
-
BooleanFuse
- Since:
- 10.0
-
-
Method Details
-
getAsBoolean
public boolean getAsBoolean()- Specified by:
getAsBoolean
in interfaceBooleanSupplier
- Since:
- 10.0
-
get
-