Interface IThrowingUnaryOperator<T>

    • Method Detail

      • of

        static <T> IThrowingUnaryOperator<T> of​(IThrowingUnaryOperator<T> operator)
        Returns the given operator, for improved variable inference. Sometimes you need to create local variables and assign them to a new lambda. This does not work well with variable inference, as Java cannot infer the type of an anonymous lambda. This utility method lets you write slightly more readable code like this:
         final var fn = IThrowingUnaryOperator.of(t -> ...);
        
         
        Type Parameters:
        T - The type of the input and output of the operator.
        Parameters:
        operator - Operator to return.
        Returns:
        The given operator.
      • throwingUnaryOperator

        static <T> IThrowingUnaryOperator<T> throwingUnaryOperator​(IThrowingUnaryOperator<T> operator)
        Returns the given operator, for improved variable inference. Sometimes you need to create local variables and assign them to a new lambda. This does not work well with variable inference, as Java cannot infer the type of an anonymous lambda. This utility method lets you write slightly more readable code like this:
         final var fn = throwingUnaryOperator(t -> ...);
        
         
        Type Parameters:
        T - The type of the input and output of the operator.
        Parameters:
        operator - Operator to return.
        Returns:
        The given operator.
      • identity

        static <T> IThrowingUnaryOperator<T> identity()
        Returns a throwing unary operator that always returns its input argument.
        Type Parameters:
        T - The type of the input and output of the operator.
        Returns:
        A throwing unary operator that always returns its input argument.