Interface DoublePredicateWithException<E extends Exception>
- 
- Type Parameters:
 E- the type of the potential exception of the function
- All Superinterfaces:
 ExceptionHandlerSupport<DoublePredicate,DoublePredicate,DoublePredicateWithException<E>>,PrimitiveReturnExceptionHandlerSupport<DoublePredicate,DoublePredicateWithException<E>>
- Functional Interface:
 - This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
 
@FunctionalInterface public interface DoublePredicateWithException<E extends Exception> extends PrimitiveReturnExceptionHandlerSupport<DoublePredicate,DoublePredicateWithException<E>>
Represents a predicate (boolean-valued function) of onedouble-valued argument that may throw exception. This is thedouble-consuming primitive type specialization ofPredicateWithException.General contract
boolean test(double value) throws E- The functional method.- uncheck - Return a 
DoublePredicate - lift - Return a 
DoublePredicate - ignore - Return a 
DoublePredicate 
- See Also:
 DoublePredicate
 
- 
- 
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default DoublePredicateWithException<E>and(DoublePredicateWithException<? extends E> other)Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another.default booleandefaultValue()Defines the default value returned by the ignore and ignored method.static <E extends Exception>
DoublePredicateWithException<E>failing(Supplier<E> exceptionBuilder)Returns a predicate that always throw exception.static <E extends Exception>
DoublePredicateignored(DoublePredicateWithException<E> predicate)Converts aDoublePredicateWithExceptionto a liftedDoublePredicatereturningfalsein case of exception.static <E extends Exception>
DoublePredicateignored(DoublePredicateWithException<E> predicate, boolean defaultValue)Converts aDoublePredicateWithExceptionto a liftedDoublePredicatereturning a default value in case of exception.static <E extends Exception>
DoublePredicatelifted(DoublePredicateWithException<E> predicate)Converts aDoublePredicateWithExceptionto a liftedDoublePredicatereturningfalsein case of exception.default DoublePredicateWithException<E>negate()Returns a predicate that represents the logical negation of this predicate.static <E extends Exception>
DoublePredicateWithException<E>negate(DoublePredicateWithException<E> predicate)Negate aDoublePredicateWithException.default DoublePredicateWithException<E>or(DoublePredicateWithException<? extends E> other)Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another.booleantest(double value)Evaluates this predicate on the given argument.static <E extends Exception>
DoublePredicateunchecked(DoublePredicateWithException<E> predicate)Converts aDoublePredicateWithExceptionto aDoublePredicatethat wraps exception toRuntimeException.static <E extends Exception>
DoublePredicateunchecked(DoublePredicateWithException<E> predicate, Function<Exception,RuntimeException> exceptionMapper)Converts aPredicateWithExceptionto aPredicatethat wraps exception toRuntimeExceptionby using the provided mapping function.default DoublePredicateuncheckOrIgnore(boolean uncheck)Used internally to implements the ignore or uncheck operation.- 
Methods inherited from interface ch.powerunit.extensions.exceptions.ExceptionHandlerSupport
documented, exceptionMapper 
- 
Methods inherited from interface ch.powerunit.extensions.exceptions.PrimitiveReturnExceptionHandlerSupport
ignore, lift, uncheck 
 - 
 
 - 
 
- 
- 
Method Detail
- 
test
boolean test(double value) throws E extends Exception
Evaluates this predicate on the given argument.- Parameters:
 value- the input argument- Returns:
 trueif the input argument matches the predicate, otherwisefalse- Throws:
 E- any exceptionE extends Exception- See Also:
 DoublePredicate.test(double)
 
- 
uncheckOrIgnore
default DoublePredicate uncheckOrIgnore(boolean uncheck)
Description copied from interface:PrimitiveReturnExceptionHandlerSupportUsed internally to implements the ignore or uncheck operation.- Specified by:
 uncheckOrIgnorein interfacePrimitiveReturnExceptionHandlerSupport<DoublePredicate,DoublePredicateWithException<E extends Exception>>- Parameters:
 uncheck- create unchecked version of the function when true, else ignored version.- Returns:
 - the function
 
 
- 
and
default DoublePredicateWithException<E> and(DoublePredicateWithException<? extends E> other)
Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another. When evaluating the composed predicate, if this predicate isfalse, then theotherpredicate is not evaluated.Any exceptions thrown during evaluation of either predicate are relayed to the caller; if evaluation of this predicate throws an exception, the
otherpredicate will not be evaluated.- Parameters:
 other- a predicate that will be logically-ANDed with this predicate- Returns:
 - a composed predicate that represents the short-circuiting logical AND
         of this predicate and the 
otherpredicate - Throws:
 NullPointerException- if other is null- See Also:
 or(DoublePredicateWithException),negate()
 
- 
negate
default DoublePredicateWithException<E> negate()
Returns a predicate that represents the logical negation of this predicate.- Returns:
 - a predicate that represents the logical negation of this predicate
 - See Also:
 and(DoublePredicateWithException),or(DoublePredicateWithException)
 
- 
negate
static <E extends Exception> DoublePredicateWithException<E> negate(DoublePredicateWithException<E> predicate)
Negate aDoublePredicateWithException.- Type Parameters:
 E- the type of the potential exception- Parameters:
 predicate- to be negate- Returns:
 - the negated predicate
 - See Also:
 negate()
 
- 
or
default DoublePredicateWithException<E> or(DoublePredicateWithException<? extends E> other)
Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another. When evaluating the composed predicate, if this predicate istrue, then theotherpredicate is not evaluated.Any exceptions thrown during evaluation of either predicate are relayed to the caller; if evaluation of this predicate throws an exception, the
otherpredicate will not be evaluated.- Parameters:
 other- a predicate that will be logically-ORed with this predicate- Returns:
 - a composed predicate that represents the short-circuiting logical OR
         of this predicate and the 
otherpredicate - Throws:
 NullPointerException- if other is null- See Also:
 and(DoublePredicateWithException),negate()
 
- 
failing
static <E extends Exception> DoublePredicateWithException<E> failing(Supplier<E> exceptionBuilder)
Returns a predicate that always throw exception.- Type Parameters:
 E- the type of the exception- Parameters:
 exceptionBuilder- the supplier to create the exception the type of the input object to the function- Returns:
 - a predicate that always throw exception
 
 
- 
unchecked
static <E extends Exception> DoublePredicate unchecked(DoublePredicateWithException<E> predicate)
Converts aDoublePredicateWithExceptionto aDoublePredicatethat wraps exception toRuntimeException.- Type Parameters:
 E- the type of the potential exception- Parameters:
 predicate- to be unchecked- Returns:
 - the unchecked predicate
 - Throws:
 NullPointerException- if predicate is null- See Also:
 PrimitiveReturnExceptionHandlerSupport.uncheck(),unchecked(DoublePredicateWithException, Function)
 
- 
unchecked
static <E extends Exception> DoublePredicate unchecked(DoublePredicateWithException<E> predicate, Function<Exception,RuntimeException> exceptionMapper)
Converts aPredicateWithExceptionto aPredicatethat wraps exception toRuntimeExceptionby using the provided mapping function.- Type Parameters:
 E- the type of the potential exception- Parameters:
 predicate- the be uncheckedexceptionMapper- a function to convert the exception to the runtime exception.- Returns:
 - the unchecked predicate
 - Throws:
 NullPointerException- if predicate or exceptionMapper is null- See Also:
 PrimitiveReturnExceptionHandlerSupport.uncheck(),unchecked(DoublePredicateWithException)
 
- 
lifted
static <E extends Exception> DoublePredicate lifted(DoublePredicateWithException<E> predicate)
Converts aDoublePredicateWithExceptionto a liftedDoublePredicatereturningfalsein case of exception.- Type Parameters:
 E- the type of the potential exception- Parameters:
 predicate- to be lifted- Returns:
 - the lifted predicate
 - Throws:
 NullPointerException- if predicate is null- See Also:
 PrimitiveReturnExceptionHandlerSupport.lift()
 
- 
ignored
static <E extends Exception> DoublePredicate ignored(DoublePredicateWithException<E> predicate)
Converts aDoublePredicateWithExceptionto a liftedDoublePredicatereturningfalsein case of exception.- Type Parameters:
 E- the type of the potential exception- Parameters:
 predicate- to be lifted- Returns:
 - the lifted predicate
 - Throws:
 NullPointerException- if predicate is null- See Also:
 PrimitiveReturnExceptionHandlerSupport.ignore()
 
- 
ignored
static <E extends Exception> DoublePredicate ignored(DoublePredicateWithException<E> predicate, boolean defaultValue)
Converts aDoublePredicateWithExceptionto a liftedDoublePredicatereturning a default value in case of exception.- Type Parameters:
 E- the type of the potential exception- Parameters:
 predicate- to be lifteddefaultValue- value in case of exception- Returns:
 - the lifted predicate
 - Throws:
 NullPointerException- if predicate is null- Since:
 - 3.0.0
 - See Also:
 PrimitiveReturnExceptionHandlerSupport.ignore(),ignored(DoublePredicateWithException)
 
- 
defaultValue
default boolean defaultValue()
Defines the default value returned by the ignore and ignored method.- Returns:
 - the default value for the ignore/ignored method.
 - Since:
 - 3.0.0
 
 
 - 
 
 -