diff --git a/src/main/java/xyz/zhouxy/jdbc/DbRecord.java b/src/main/java/xyz/zhouxy/jdbc/DbRecord.java
deleted file mode 100644
index 16edef9..0000000
--- a/src/main/java/xyz/zhouxy/jdbc/DbRecord.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2022-2024 the original author or authors.
- *
- * 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;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-import java.util.OptionalDouble;
-import java.util.OptionalInt;
-import java.util.OptionalLong;
-
-import javax.annotation.Nonnull;
-
-import com.google.common.annotations.Beta;
-
-import xyz.zhouxy.plusone.commons.collection.AbstractMapWrapper;
-import xyz.zhouxy.plusone.commons.util.AssertTools;
-import xyz.zhouxy.plusone.commons.util.OptionalTools;
-import xyz.zhouxy.plusone.commons.util.StringTools;
-
-/**
- * DbRecord
- *
- *
- * 封装 Map,表示一条 DB 记录
- *
- *
- * @author ZhouXY
- * @since 1.0.0
- */
-@Beta
-public class DbRecord extends AbstractMapWrapper {
-
- public DbRecord() {
- super(new HashMap<>(),
- k -> AssertTools.checkArgument(StringTools.isNotBlank(k), "Key must has text."),
- null);
- }
-
- public DbRecord(Map map) {
- super(map,
- k -> AssertTools.checkArgument(StringTools.isNotBlank(k), "Key must has text."),
- null);
- }
-
- /**
- * 将值强转为 {@link String},并放在 {@link Optional} 中。
- * 如果 {@code key} 存在,而值不存在,则返回 {@link Optional#empty()}。
- */
- public Optional getValueAsString(String key) {
- return this.getAndConvert(key);
- }
-
- /**
- * 将值强转为 {@code int},并放在 {@link OptionalInt} 中。
- * 如果 {@code key} 存在,而值不存在,则返回 {@link OptionalInt#empty()}。
- */
- @Nonnull
- public OptionalInt getValueAsInt(String key) {
- return OptionalTools.toOptionalInt(this.getAndConvert(key));
- }
-
- /**
- * 将值强转为 {@code long},并放在 {@link OptionalLong} 中。
- * 如果 {@code key} 存在,而值不存在,则返回 {@link OptionalLong#empty()}。
- */
- @Nonnull
- public OptionalLong getValueAsLong(String key) {
- return OptionalTools.toOptionalLong(this.getAndConvert(key));
- }
-
- /**
- * 将值强转为 {@code double},并放在 {@link OptionalDouble} 中。
- * 如果 {@code key} 存在,而值不存在,则返回 {@link OptionalDouble#empty()}。
- */
- @Nonnull
- public OptionalDouble getValueAsDouble(String key) {
- return OptionalTools.toOptionalDouble(this.getAndConvert(key));
- }
-
- @Override
- protected DbRecord getSelf() {
- return this;
- }
-
- private static final String STR_PREFIX = DbRecord.class.getName() + '@';
-
- @Override
- public String toString() {
- return STR_PREFIX + super.toString();
- }
-}
diff --git a/src/main/java/xyz/zhouxy/jdbc/JdbcOperationSupport.java b/src/main/java/xyz/zhouxy/jdbc/JdbcOperationSupport.java
index 974c5d7..5e1adab 100644
--- a/src/main/java/xyz/zhouxy/jdbc/JdbcOperationSupport.java
+++ b/src/main/java/xyz/zhouxy/jdbc/JdbcOperationSupport.java
@@ -26,6 +26,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -444,23 +445,28 @@ class JdbcOperationSupport {
// #region - 参数校验
private static void assertConnectionNotNull(Connection conn) {
- AssertTools.checkArgumentNotNull(conn, "The argument \"conn\" could not be null.");
+ AssertTools.checkArgument(Objects.nonNull(conn),
+ "The argument \"conn\" could not be null.");
}
private static void assertSqlNotNull(String sql) {
- AssertTools.checkArgumentNotNull(sql, "The argument \"sql\" could not be null.");
+ AssertTools.checkArgument(Objects.nonNull(sql),
+ "The argument \"sql\" could not be null.");
}
private static void assertRowMapperNotNull(RowMapper> rowMapper) {
- AssertTools.checkArgumentNotNull(rowMapper, "The argument \"rowMapper\" could not be null.");
+ AssertTools.checkArgument(Objects.nonNull(rowMapper),
+ "The argument \"rowMapper\" could not be null.");
}
private static void assertResultHandlerNotNull(ResultHandler> resultHandler) {
- AssertTools.checkArgumentNotNull(resultHandler, "The argument \"resultHandler\" could not be null.");
+ AssertTools.checkArgument(Objects.nonNull(resultHandler),
+ "The argument \"resultHandler\" could not be null.");
}
private static void assertClazzNotNull(Class> clazz) {
- AssertTools.checkArgumentNotNull(clazz, "The argument \"clazz\" could not be null.");
+ AssertTools.checkArgument(Objects.nonNull(clazz),
+ "The argument \"clazz\" could not be null.");
}
// #endregion
diff --git a/src/main/java/xyz/zhouxy/jdbc/JdbcOperations.java b/src/main/java/xyz/zhouxy/jdbc/JdbcOperations.java
index b0e34df..61468be 100644
--- a/src/main/java/xyz/zhouxy/jdbc/JdbcOperations.java
+++ b/src/main/java/xyz/zhouxy/jdbc/JdbcOperations.java
@@ -79,15 +79,6 @@ interface JdbcOperations {
List