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