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