Interface JdbcFunction.SurroundOperator<T,​R>

  • Type Parameters:
    T - The type of fed object
    R - The type of returned object
    All Known Implementing Classes:
    Transactional
    Enclosing interface:
    JdbcFunction<T,​R>
    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 static interface JdbcFunction.SurroundOperator<T,​R>
    This operator is used to surround fed JdbcFunction by the implementation of surrounding.

    For example:

    
     static <T, R> JdbcFunction.SurroundOperator<T, R> buildLogging(Logger logger)
     {
         return surroundedFunc -> v -> {
             logger.info("Before Invoke: {}", v);
    
             R result = surroundedFunc.apply(v);
    
             logger.info("After Invoke: {}", v);
    
             return result;
         };
     }
    
     JdbcFunction<Integer, Integer> loggedFunc = sourceFunc.surroundedBy(buildLogging(logger));
     
    See Also:
    JdbcFunction.surroundedBy(guru.mikelue.jdut.jdbc.JdbcFunction.SurroundOperator<T, R>)
    • Method Detail

      • surround

        JdbcFunction<T,​R> surround​(JdbcFunction<T,​R> surroundedFunction)
        Surrounds function.
        Parameters:
        surroundedFunction - The function to be surrounded
        Returns:
        The final function