Package com.pivovarit.function
Interface ThrowingUnaryOperator<T,E extends java.lang.Exception>
-
- Type Parameters:
T
- the type of the operand and result of the operatorE
- the type of the thrown checked exception
- All Superinterfaces:
ThrowingFunction<T,T,E>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ThrowingUnaryOperator<T,E extends java.lang.Exception> extends ThrowingFunction<T,T,E>
Represents an operation on a single operand that produces a result of the same type as its operand. This is a specialization ofFunction
for the case where the operand and result are of the same type. Function may throw a checked exception.- See Also:
ThrowingFunction
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static <T> java.util.function.UnaryOperator<T>
sneaky(ThrowingUnaryOperator<T,?> operator)
Returns a new UnaryOperator instance which rethrows the checked exception using the Sneaky Throws patterndefault java.util.function.UnaryOperator<T>
uncheck()
Returns a new UnaryOperator instance which wraps thrown checked exception instance into a RuntimeExceptionstatic <T> java.util.function.UnaryOperator<T>
unchecked(ThrowingUnaryOperator<T,?> operator)
-
Methods inherited from interface com.pivovarit.function.ThrowingFunction
andThen, apply, compose, lift
-
-
-
-
Method Detail
-
unchecked
static <T> java.util.function.UnaryOperator<T> unchecked(ThrowingUnaryOperator<T,?> operator)
-
sneaky
static <T> java.util.function.UnaryOperator<T> sneaky(ThrowingUnaryOperator<T,?> operator)
Returns a new UnaryOperator instance which rethrows the checked exception using the Sneaky Throws pattern- Returns:
- UnaryOperator instance that rethrows the checked exception using the Sneaky Throws pattern
-
-