mirror of
https://github.com/CarmJos/EasySQL.git
synced 2026-06-05 00:25:32 +08:00
修改代码演示的位置
This commit is contained in:
@@ -7,6 +7,7 @@ import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
public interface SQLAction<T> {
|
||||
|
||||
@@ -22,6 +23,13 @@ public interface SQLAction<T> {
|
||||
|
||||
@NotNull T execute() throws SQLException;
|
||||
|
||||
@Nullable
|
||||
default <R> R execute(@NotNull Function<T, R> function, @Nullable BiConsumer<SQLException, SQLAction<T>> exceptionHandler) {
|
||||
T value = execute(exceptionHandler);
|
||||
if (value == null) return null;
|
||||
else return function.apply(value);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
default T execute(@Nullable BiConsumer<SQLException, SQLAction<T>> exceptionHandler) {
|
||||
if (exceptionHandler == null) exceptionHandler = defaultExceptionHandler();
|
||||
|
||||
Reference in New Issue
Block a user