Package com.pivovarit.function
Interface ThrowingUnaryOperator<T,E extends 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 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 of
Function
for
the case where the operand and result are of the same type.
Function may throw a checked exception.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> UnaryOperator
<T> sneaky
(ThrowingUnaryOperator<T, ?> operator) Returns a new UnaryOperator instance which rethrows the checked exception using the Sneaky Throws patterndefault UnaryOperator
<T> uncheck()
Returns a new UnaryOperator instance which wraps thrown checked exception instance into a RuntimeExceptionstatic <T> UnaryOperator
<T> unchecked
(ThrowingUnaryOperator<T, ?> operator) Methods inherited from interface com.pivovarit.function.ThrowingFunction
andThen, apply, compose, lift
-
Method Details
-
unchecked
-
sneaky
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
-
uncheck
Returns a new UnaryOperator instance which wraps thrown checked exception instance into a RuntimeException
-