Package guru.mikelue.jdut.jdbc
Interface JdbcVoidFunction<T>
-
- Type Parameters:
T- The type of fed 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 JdbcVoidFunction<T>
Likes theConsumerinterface with throwing ofSQLException.- See Also:
JdbcSupplier,JdbcRunnable,SQLExceptionConvert
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidapplyJdbc(T jdbcObject)Consumes the object.default Consumer<T>asConsumer()Converts this expression toConsumer.default <E extends RuntimeException>
Consumer<T>asConsumer(SQLExceptionConvert<E> exceptionConvert)Converts this expression toConsumer, with customizedSQLExceptionConvert.default JdbcFunction<T,Void>asJdbcFunction()GetsJdbcFunctionby this void function.static <T> JdbcVoidFunction<T>fromJdbcFunction(JdbcFunction<T,?> jdbcFunction)Creates this instance fromJdbcFunction.default JdbcFunction<T,Void>surroundedBy(JdbcFunction.SurroundOperator<T,Void> surroundOperator)Surrounds this function byJdbcFunction.SurroundOperator.
-
-
-
Method Detail
-
fromJdbcFunction
static <T> JdbcVoidFunction<T> fromJdbcFunction(JdbcFunction<T,?> jdbcFunction)
Creates this instance fromJdbcFunction.- Type Parameters:
T- The type of fed object- Parameters:
jdbcFunction- The function of JDBC- Returns:
- The using of jdbcFunction without returned value
-
asConsumer
default Consumer<T> asConsumer()
Converts this expression toConsumer.- Returns:
- The function with
SQLExceptionConvert::runtimeException - See Also:
asConsumer(SQLExceptionConvert)
-
asConsumer
default <E extends RuntimeException> Consumer<T> asConsumer(SQLExceptionConvert<E> exceptionConvert)
Converts this expression toConsumer, with customizedSQLExceptionConvert.- Type Parameters:
E- The type of exception to be generated by- Parameters:
exceptionConvert- The instance for convertingSQLExceptionto exception of type <E>- Returns:
- The function with
SQLExceptionConvert - See Also:
asConsumer()
-
asJdbcFunction
default JdbcFunction<T,Void> asJdbcFunction()
GetsJdbcFunctionby this void function.- Returns:
- The null value of returned function
-
surroundedBy
default JdbcFunction<T,Void> surroundedBy(JdbcFunction.SurroundOperator<T,Void> 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
void applyJdbc(T jdbcObject) throws SQLException
Consumes the object.- Parameters:
jdbcObject- The fed object- Throws:
SQLException- eliminate the exception block of JDBC
-
-