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