T
- see BiPredicate
U
- see BiPredicate
@FunctionalInterface public interface OptionalBiPredicate<T,U>
BiPredicate
that returns OptionalBoolean
instead of the raw value. OptionalBiPredicate
is typically obtained from ExceptionHandler.fromBiPredicate(BiPredicate)
, in which case its return value is empty when the underlying BiPredicate
throws an exception. See noexception tutorial.
Modifier and Type | Method and Description |
---|---|
default BiPredicate<T,U> |
orElse(boolean result)
Converts this OptionalBiPredicate to plain BiPredicate using default value.
|
default BiPredicate<T,U> |
orElseGet(BooleanSupplier source)
|
OptionalBoolean |
test(T t, U u)
Variation of BiPredicate.test(Object, Object) that returns OptionalBoolean .
|
OptionalBoolean test(T t, U u)
BiPredicate.test(Object, Object)
that returns OptionalBoolean
. If this OptionalBiPredicate
is obtained from ExceptionHandler.fromBiPredicate(BiPredicate)
, the OptionalBoolean
will be empty only if the underlying BiPredicate
throws. Otherwise the returned OptionalBoolean
just wraps the return value of underlying BiPredicate
.
t
- see BiPredicate.test(Object, Object)
u
- see BiPredicate.test(Object, Object)
OptionalBoolean
typically wrapping return value of BiPredicate.test(Object, Object)
, or an empty OptionalBoolean
(typically signifying an exception)
ExceptionHandler.fromBiPredicate(BiPredicate)
, BiPredicate.test(Object, Object)
default BiPredicate<T,U> orElse(boolean result)
OptionalBiPredicate
to plain BiPredicate
using default value. The returned BiPredicate
will unwrap present value from the OptionalBoolean
if possible, or return result
if the OptionalBoolean
is empty.
result
- default value to return instead of an empty OptionalBoolean
BiPredicate
that either unwraps OptionalBoolean
or returns default value
orElseGet(BooleanSupplier)
, OptionalBoolean.orElse(boolean)
default BiPredicate<T,U> orElseGet(BooleanSupplier source)
OptionalBiPredicate
to plain BiPredicate
using fallback BooleanSupplier
. The returned BiPredicate
will unwrap present value from the OptionalBoolean
if possible, or fall back to calling source
if the OptionalBoolean
is empty.
source
- BooleanSupplier
to query for fallback value when OptionalBoolean
is empty
BiPredicate
that either unwraps OptionalBoolean
or falls back to source
orElse(boolean)
, OptionalBoolean.orElseGet(BooleanSupplier)
Copyright © 2017–2020 Robert Važan. All rights reserved.