Interface BooleanSupplier

All Superinterfaces:
BooleanSupplier

public interface BooleanSupplier extends BooleanSupplier
An enhanced boolean supplier.
Author:
Paul Ferraro
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final BooleanSupplier
     
    static final BooleanSupplier
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default Supplier<Boolean>
    Returns a boxed version of this supplier.
    Returns a new supplier that delegates to this supplier using the specified exception handler.
    default <V> Supplier<V>
    map(Supplier<V> whenTrue, Supplier<V> whenFalse)
    Returns an if/else supplier that delegates to the first specified supplier when this supplier evaluates to true, or the second specified supplier when this supplier evaluates to false.
    of(boolean value)
    Returns a supplier that always returns the specified value.

    Methods inherited from interface java.util.function.BooleanSupplier

    getAsBoolean
  • Field Details

  • Method Details

    • map

      default <V> Supplier<V> map(Supplier<V> whenTrue, Supplier<V> whenFalse)
      Returns an if/else supplier that delegates to the first specified supplier when this supplier evaluates to true, or the second specified supplier when this supplier evaluates to false.
      Type Parameters:
      V - the mapped value type
      Parameters:
      whenTrue - the mapped supplier when evaluating to true
      whenFalse - the mapped supplier when evaluating to false
      Returns:
      an if/else supplier that delegates to the first specified supplier when this supplier evaluates to true, or the second specified supplier when this supplier evaluates to false.
    • boxed

      default Supplier<Boolean> boxed()
      Returns a boxed version of this supplier.
      Returns:
      a boxed version of this supplier.
    • handle

      default BooleanSupplier handle(Predicate<RuntimeException> handler)
      Returns a new supplier that delegates to this supplier using the specified exception handler.
      Parameters:
      handler - an exception handler
      Returns:
      a new supplier that delegates to this supplier using the specified exception handler.
    • of

      static BooleanSupplier of(boolean value)
      Returns a supplier that always returns the specified value.
      Parameters:
      value - the supplied value
      Returns:
      a supplier that always returns the specified value.