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