Interface ThrowingUnaryOperator<T,E extends Exception>

Type Parameters:
T - the type of the operand and result of the operator
E - 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 Details

    • unchecked

      static <T> UnaryOperator<T> unchecked(ThrowingUnaryOperator<T,?> operator)
    • sneaky

      static <T> 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
    • uncheck

      default UnaryOperator<T> uncheck()
      Returns a new UnaryOperator instance which wraps thrown checked exception instance into a RuntimeException
      Specified by:
      uncheck in interface ThrowingFunction<T,T,E extends Exception>