Class BooleanFuse

  • All Implemented Interfaces:
    Supplier<Boolean>

    public class BooleanFuse
    extends Object
    implements Supplier<Boolean>
    Wraps a boolean supplier to prevent the returned value from changing once 'tripped'.
    • Constructor Detail

      • 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