Package guru.mikelue.jdut.jdbc
Interface JdbcFunction.SurroundOperator<T,R>
-
- Type Parameters:
T
- The type of fed objectR
- 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 fedJdbcFunction
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));
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default UnaryOperator<JdbcFunction<T,R>>
asUnaryOperator()
Converts this operator otUnaryOperator
.JdbcFunction<T,R>
surround(JdbcFunction<T,R> surroundedFunction)
Surrounds function.
-
-
-
Method Detail
-
asUnaryOperator
default UnaryOperator<JdbcFunction<T,R>> asUnaryOperator()
Converts this operator otUnaryOperator
.- Returns:
- The unary operator
-
surround
JdbcFunction<T,R> surround(JdbcFunction<T,R> surroundedFunction)
Surrounds function.- Parameters:
surroundedFunction
- The function to be surrounded- Returns:
- The final function
-
-