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