Package guru.mikelue.jdut.operation
Interface DataGrainOperator
-
- 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 DataGrainOperator
Operator to execute code by fedDataGrain
.- See Also:
- Provided operators
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
DataGrainOperator.SurroundOperator
The operator for surrounding ofDataGrainOperator
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default BiConsumer<Connection,DataGrain>
asBiConsumer()
Converts this operator toBiConsumer
with defaultSQLExceptionConvert
.default <E extends RuntimeException>
BiConsumer<Connection,DataGrain>asBiConsumer(SQLExceptionConvert<E> sqlExceptionConvert)
static DataGrain
none(Connection conn, DataGrain dataGrain)
Does nothing.DataGrain
operate(Connection connection, DataGrain dataGrain)
OperatesDataGrain
byConnection
.default DataGrainOperator
surroundedBy(DataGrainOperator.SurroundOperator surroundOperator)
Surrounds this instance byDataGrainOperator.SurroundOperator
.default JdbcFunction<Connection,DataGrain>
toJdbcFunction(DataGrain dataGrain)
Converts this lambda toJdbcFunction
.
-
-
-
Method Detail
-
none
static DataGrain none(Connection conn, DataGrain dataGrain)
Does nothing.- Parameters:
conn
- The connection objectdataGrain
- The object of data grain- Returns:
- The same data grain
-
toJdbcFunction
default JdbcFunction<Connection,DataGrain> toJdbcFunction(DataGrain dataGrain)
Converts this lambda toJdbcFunction
.- Parameters:
dataGrain
- The data grain to be fed- Returns:
- The JDBC function
-
asBiConsumer
default <E extends RuntimeException> BiConsumer<Connection,DataGrain> asBiConsumer(SQLExceptionConvert<E> sqlExceptionConvert)
- Type Parameters:
E
- The type of runtime exception- Parameters:
sqlExceptionConvert
- The conversion of SQLException- Returns:
- A
BiConsumer
instance
-
asBiConsumer
default BiConsumer<Connection,DataGrain> asBiConsumer()
Converts this operator toBiConsumer
with defaultSQLExceptionConvert
.- Returns:
- A
BiConsumer
instance
-
surroundedBy
default DataGrainOperator surroundedBy(DataGrainOperator.SurroundOperator surroundOperator)
Surrounds this instance byDataGrainOperator.SurroundOperator
.- Parameters:
surroundOperator
- The operator to surrounding staff- Returns:
- new operator of data grain
-
operate
DataGrain operate(Connection connection, DataGrain dataGrain) throws SQLException
OperatesDataGrain
byConnection
.- Parameters:
connection
- The connection of databasedataGrain
- The data grain to be operated- Returns:
- The processed data grain
- Throws:
SQLException
- The SQL exception defined by JDBC
-
-