Interface ExLongUnaryOperator<E extends Exception>

Type Parameters:
E - the type of exception thrown
All Superinterfaces:
Wrappable<LongUnaryOperator>
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 ExLongUnaryOperator<E extends Exception> extends Wrappable<LongUnaryOperator>
Equivalent of a LongUnaryOperator that can throw exceptions.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    applyAsLong(long operand)
    Applies this operator to the given operand.
    Returns a unary operator that always returns its input argument.
    Wraps this functional interface, allowing it to be used in contexts where exceptions are not allowed to be thrown directly.
  • Method Details

    • applyAsLong

      long applyAsLong(long operand) throws E
      Applies this operator to the given operand.
      Parameters:
      operand - the operand
      Returns:
      the operator result
      Throws:
      E - potentially
    • wrap

      default @NonNull LongUnaryOperator wrap()
      Description copied from interface: Wrappable
      Wraps this functional interface, allowing it to be used in contexts where exceptions are not allowed to be thrown directly.

      If a checked exception is thrown, an ExException, which is a runtime exception, will be thrown instead. This will have the original exception as its cause.

      Specified by:
      wrap in interface Wrappable<E extends Exception>
      Returns:
      a wrapped instance of type W
    • identity

      static <E extends Exception> @NonNull ExLongUnaryOperator<E> identity()
      Returns a unary operator that always returns its input argument.
      Type Parameters:
      E - the type of exception thrown
      Returns:
      a unary operator that always returns its input argument