Package guru.mikelue.jdut.jdbc
Interface JdbcFunction<T,R>
-
- Type Parameters:
T
- The type of fed objectR
- The type of returned object
- 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 JdbcFunction<T,R>
Likes theFunction
interface with throwing ofSQLException
.See
JDBC Function
for usage of this lambda expression.- See Also:
JdbcRunnable
,JdbcSupplier
,JdbcVoidFunction
,SQLExceptionConvert
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
JdbcFunction.SurroundOperator<T,R>
This operator is used to surround fedJdbcFunction
by the implementation of surrounding.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description R
applyJdbc(T jdbcObject)
Gives object of type <R> object by fed object of type <T>.default Function<T,R>
asFunction()
Converts this expression toFunction
.default <E extends RuntimeException>
Function<T,R>asFunction(SQLExceptionConvert<E> exceptionConvert)
Converts this expression toFunction
, with customizedSQLExceptionConvert
.default JdbcFunction<T,R>
surroundedBy(JdbcFunction.SurroundOperator<T,R> surroundOperator)
Surrounds this function byJdbcFunction.SurroundOperator
.
-
-
-
Method Detail
-
asFunction
default Function<T,R> asFunction()
Converts this expression toFunction
.- Returns:
- The function with
SQLExceptionConvert::runtimeException
- See Also:
asFunction(SQLExceptionConvert)
-
asFunction
default <E extends RuntimeException> Function<T,R> asFunction(SQLExceptionConvert<E> exceptionConvert)
Converts this expression toFunction
, with customizedSQLExceptionConvert
.- Type Parameters:
E
- The type of exception to be generated by- Parameters:
exceptionConvert
- The instance for convertingSQLException
to exception of type <E>- Returns:
- The function with
SQLExceptionConvert
- See Also:
asFunction()
-
surroundedBy
default JdbcFunction<T,R> surroundedBy(JdbcFunction.SurroundOperator<T,R> surroundOperator)
Surrounds this function byJdbcFunction.SurroundOperator
.- Parameters:
surroundOperator
- The operator to build a new function to surround current function- Returns:
- The surround function of result
- See Also:
JdbcFunction.SurroundOperator
-
applyJdbc
R applyJdbc(T jdbcObject) throws SQLException
Gives object of type <R> object by fed object of type <T>.- Parameters:
jdbcObject
- The object to be fed- Returns:
- The generated object
- Throws:
SQLException
- eliminate the exception block of JDBC
-
-