public class DoubleToIntFunctionChainer extends Chainer<DoubleToIntFunction,ThrowingDoubleToIntFunction,DoubleToIntFunctionChainer> implements ThrowingDoubleToIntFunction
Chainer.InstantiationException| Constructor and Description |
|---|
DoubleToIntFunctionChainer(ThrowingDoubleToIntFunction throwing) |
| Modifier and Type | Method and Description |
|---|---|
int |
doApplyAsInt(double value) |
DoubleToIntFunction |
fallbackTo(DoubleToIntFunction fallback)
Fall back to a non throwing instance if this instance fails
|
DoubleToIntFunction |
orReturn(int retval) |
<E extends RuntimeException> |
orThrow(Class<E> exclass)
Rethrow the exception using a custom (unchecked!) exception class if this
throwing instance fails
|
DoubleToIntFunctionChainer |
orTryWith(ThrowingDoubleToIntFunction other)
Try with another throwing instance if the first instance fails
|
DoubleToIntFunction |
sneakyThrow()
Sneaky throw of the exception thrown by the instance
|
doSneakyThrow, rethrowclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplyAsIntpublic DoubleToIntFunctionChainer(ThrowingDoubleToIntFunction throwing)
public int doApplyAsInt(double value)
throws Throwable
doApplyAsInt in interface ThrowingDoubleToIntFunctionThrowablepublic DoubleToIntFunctionChainer orTryWith(ThrowingDoubleToIntFunction other)
ChainerorTryWith in class Chainer<DoubleToIntFunction,ThrowingDoubleToIntFunction,DoubleToIntFunctionChainer>other - the other throwing instancepublic <E extends RuntimeException> ThrowingDoubleToIntFunction 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<DoubleToIntFunction,ThrowingDoubleToIntFunction,DoubleToIntFunctionChainer>E - type parameter of the exception classexclass - the exception classpublic DoubleToIntFunction fallbackTo(DoubleToIntFunction fallback)
ChainerfallbackTo in class Chainer<DoubleToIntFunction,ThrowingDoubleToIntFunction,DoubleToIntFunctionChainer>fallback - the fallback instancepublic DoubleToIntFunction sneakyThrow()
ChainerThis code was inspited by the Lombok project.
sneakyThrow in class Chainer<DoubleToIntFunction,ThrowingDoubleToIntFunction,DoubleToIntFunctionChainer>public DoubleToIntFunction orReturn(int retval)