public class DoublePredicateChainer extends Chainer<DoublePredicate,ThrowingDoublePredicate,DoublePredicateChainer> implements ThrowingDoublePredicate
Chainer.InstantiationException| Constructor and Description |
|---|
DoublePredicateChainer(ThrowingDoublePredicate throwing) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
doTest(double value) |
DoublePredicate |
fallbackTo(DoublePredicate fallback)
Fall back to a non throwing instance if this instance fails
|
DoublePredicate |
orReturnFalse() |
DoublePredicate |
orReturnTrue() |
<E extends RuntimeException> |
orThrow(Class<E> exclass)
Rethrow the exception using a custom (unchecked!) exception class if this
throwing instance fails
|
DoublePredicateChainer |
orTryWith(ThrowingDoublePredicate other)
Try with another throwing instance if the first instance fails
|
DoublePredicate |
sneakyThrow()
Sneaky throw of the exception thrown by the instance
|
doSneakyThrow, rethrowclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittestand, negate, orpublic DoublePredicateChainer(ThrowingDoublePredicate throwing)
public boolean doTest(double value)
throws Throwable
doTest in interface ThrowingDoublePredicateThrowablepublic DoublePredicateChainer orTryWith(ThrowingDoublePredicate other)
ChainerorTryWith in class Chainer<DoublePredicate,ThrowingDoublePredicate,DoublePredicateChainer>other - the other throwing instancepublic <E extends RuntimeException> ThrowingDoublePredicate orThrow(Class<E> exclass)
ChainerYour custom exception class must have a constructor
accepting a single Throwable as an argument.
The original exception thrown will be the cause of the generated exception.
All instances of Error or RuntimeException thrown by
the instance are thrown as is.
orThrow in class Chainer<DoublePredicate,ThrowingDoublePredicate,DoublePredicateChainer>E - type parameter of the exception classexclass - the exception classpublic DoublePredicate fallbackTo(DoublePredicate fallback)
ChainerfallbackTo in class Chainer<DoublePredicate,ThrowingDoublePredicate,DoublePredicateChainer>fallback - the fallback instancepublic DoublePredicate sneakyThrow()
ChainerThis code was inspited by the Lombok project.
sneakyThrow in class Chainer<DoublePredicate,ThrowingDoublePredicate,DoublePredicateChainer>public DoublePredicate orReturnTrue()
public DoublePredicate orReturnFalse()