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