Files
simple-jdbc/src/main/java/xyz/zhouxy/jdbc/ThrowingConsumer.java
ZhouXY108 a0df4136f4 refactor!: 移除 plusone-commons 及 Guava 依赖,内化工具方法
完全移除对外部工具库 plusone-commons 和 Guava 的编译期依赖,
将所需功能内化实现,使项目成为真正的零依赖轻量级 JDBC 封装库。

- 新增 AssertTools: 断言工具(checkArgument / checkNotNull / checkState / checkCondition)
- 新增 NamingTools: 命名转换(camelToSnake)
- 新增 ThrowingConsumer / ThrowingPredicate: 可抛受检异常的函数式接口
- 新增 AssertToolsTests: 完整覆盖断言工具所有方法及边界场景
- pom.xml 移除 plusone-dependencies BOM,直接声明 jsr305 / test 依赖版本
- DefaultBeanRowMapper 使用 NamingTools.camelToSnake 替代 Guava CaseFormat
- ParamBuilder 内联 Optional 展开逻辑,去除 OptionalTools / CollectionTools
- JdbcOperationSupport 用 null/长度判断替代 ArrayTools.isEmpty/isNotEmpty
- NOTICE 移除第三方依赖声明;README 移除无依赖分支说明
- 测试:新增缩写映射(URL/XML/ID/HTML/HTTP)覆盖、TransactionException 构造器测试

BREAKING CHANGE: BatchUpdateStatus 不再实现 IWithIntCode 接口;
plusone-commons 和 Guava 不再作为传递依赖提供。
2026-06-17 17:21:31 +08:00

42 lines
1.1 KiB
Java

/*
* Copyright 2026-present ZhouXY
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package xyz.zhouxy.jdbc;
/**
* 可抛出受检异常的函数式接口。
*
* <p>
* 类似于 {@link java.util.function.Consumer},但 {@code accept} 方法允许抛出受检异常。
* </p>
*
* @param <T> 输入类型
* @param <E> 允许抛出的异常类型
* @author ZhouXY
* @since 1.1.0
*/
@FunctionalInterface
public interface ThrowingConsumer<T, E extends Exception> {
/**
* 对给定参数执行此操作。
*
* @param t 输入参数
* @throws E 异常
*/
void accept(T t) throws E;
}