This commit is contained in:
Looly 2025-06-25 11:23:36 +08:00
parent a7c5259d4b
commit 9d83869d85
36 changed files with 248 additions and 95 deletions

View File

@ -34,7 +34,7 @@ public class BaseConfig implements AIConfig {
//具体模型 //具体模型
protected volatile String model; protected volatile String model;
//动态扩展字段 //动态扩展字段
protected Map<String, Object> additionalConfig = new ConcurrentHashMap<>(); protected final Map<String, Object> additionalConfig = new ConcurrentHashMap<>();
//连接超时时间 //连接超时时间
protected volatile int timeout = 180000; protected volatile int timeout = 180000;
//读取超时时间 //读取超时时间

View File

@ -35,6 +35,7 @@ import java.util.Map;
* @since 5.7.23 * @since 5.7.23
*/ */
public class AnnotationProxy<T extends Annotation> implements Annotation, InvocationHandler, Serializable { public class AnnotationProxy<T extends Annotation> implements Annotation, InvocationHandler, Serializable {
@Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**

View File

@ -48,7 +48,7 @@ public class CacheObj<K, V> implements Serializable {
/** /**
* 访问次数 * 访问次数
*/ */
protected AtomicLong accessCount = new AtomicLong(); protected final AtomicLong accessCount = new AtomicLong();
/** /**
* 对象存活时长0表示永久存活 * 对象存活时长0表示永久存活
*/ */

View File

@ -21,6 +21,7 @@ import cn.hutool.v7.core.codec.Encoder;
import cn.hutool.v7.core.array.ArrayUtil; import cn.hutool.v7.core.array.ArrayUtil;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -31,6 +32,7 @@ import java.io.Serializable;
* @since 4.5.9 * @since 4.5.9
*/ */
public class Base62Codec implements Encoder<byte[], byte[]>, Decoder<byte[], byte[]>, Serializable { public class Base62Codec implements Encoder<byte[], byte[]>, Decoder<byte[], byte[]>, Serializable {
@Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final int STANDARD_BASE = 256; private static final int STANDARD_BASE = 256;
@ -39,7 +41,7 @@ public class Base62Codec implements Encoder<byte[], byte[]>, Decoder<byte[], byt
/** /**
* 单例 * 单例
*/ */
public static Base62Codec INSTANCE = new Base62Codec(); public static final Base62Codec INSTANCE = new Base62Codec();
/** /**
* 编码指定消息bytes为Base62格式的bytes * 编码指定消息bytes为Base62格式的bytes
@ -124,11 +126,11 @@ public class Base62Codec implements Encoder<byte[], byte[]>, Decoder<byte[], byt
/** /**
* GMP风格编码器 * GMP风格编码器
*/ */
public static Base62Encoder GMP_ENCODER = new Base62Encoder(GMP); public static final Base62Encoder GMP_ENCODER = new Base62Encoder(GMP);
/** /**
* 反转风格即将GMP风格中的大小写做转换编码器 * 反转风格即将GMP风格中的大小写做转换编码器
*/ */
public static Base62Encoder INVERTED_ENCODER = new Base62Encoder(INVERTED); public static final Base62Encoder INVERTED_ENCODER = new Base62Encoder(INVERTED);
private final byte[] alphabet; private final byte[] alphabet;
@ -158,11 +160,11 @@ public class Base62Codec implements Encoder<byte[], byte[]>, Decoder<byte[], byt
/** /**
* GMP风格解码器 * GMP风格解码器
*/ */
public static Base62Decoder GMP_DECODER = new Base62Decoder(Base62Encoder.GMP); public static final Base62Decoder GMP_DECODER = new Base62Decoder(Base62Encoder.GMP);
/** /**
* 反转风格即将GMP风格中的大小写做转换解码器 * 反转风格即将GMP风格中的大小写做转换解码器
*/ */
public static Base62Decoder INVERTED_DECODER = new Base62Decoder(Base62Encoder.INVERTED); public static final Base62Decoder INVERTED_DECODER = new Base62Decoder(Base62Encoder.INVERTED);
private final byte[] lookupTable; private final byte[] lookupTable;

View File

@ -20,6 +20,7 @@ import cn.hutool.v7.core.codec.Decoder;
import cn.hutool.v7.core.lang.mutable.MutableInt; import cn.hutool.v7.core.lang.mutable.MutableInt;
import cn.hutool.v7.core.array.ArrayUtil; import cn.hutool.v7.core.array.ArrayUtil;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -31,12 +32,13 @@ import java.io.Serializable;
* *
*/ */
public class Base64Decoder implements Decoder<byte[], byte[]>, Serializable { public class Base64Decoder implements Decoder<byte[], byte[]>, Serializable {
@Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 单例对象 * 单例对象
*/ */
public static Base64Decoder INSTANCE = new Base64Decoder(); public static final Base64Decoder INSTANCE = new Base64Decoder();
private static final byte PADDING = -2; private static final byte PADDING = -2;

View File

@ -36,7 +36,7 @@ public class CityHash implements Hash32<byte[]>, Hash64<byte[]>, Hash128<byte[]>
/** /**
* 单例 * 单例
*/ */
public static CityHash INSTANCE = new CityHash(); public static final CityHash INSTANCE = new CityHash();
// Some primes between 2^63 and 2^64 for various uses. // Some primes between 2^63 and 2^64 for various uses.
private static final long k0 = 0xc3a5c85c97cb3127L; private static final long k0 = 0xc3a5c85c97cb3127L;

View File

@ -16,6 +16,7 @@
package cn.hutool.v7.core.codec.hash; package cn.hutool.v7.core.codec.hash;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.util.Collection; import java.util.Collection;
import java.util.SortedMap; import java.util.SortedMap;
@ -30,6 +31,7 @@ import java.util.TreeMap;
* @author Looly * @author Looly
*/ */
public class ConsistentHash<T> implements Serializable { public class ConsistentHash<T> implements Serializable {
@Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**

View File

@ -29,6 +29,7 @@ import cn.hutool.v7.core.reflect.ConstructorUtil;
import cn.hutool.v7.core.reflect.TypeUtil; import cn.hutool.v7.core.reflect.TypeUtil;
import cn.hutool.v7.core.text.StrUtil; import cn.hutool.v7.core.text.StrUtil;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.Map; import java.util.Map;
@ -45,12 +46,13 @@ import java.util.Map;
* @since 4.0.2 * @since 4.0.2
*/ */
public class BeanConverter implements Converter, Serializable { public class BeanConverter implements Converter, Serializable {
@Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 单例对象 * 单例对象
*/ */
public static BeanConverter INSTANCE = new BeanConverter(); public static final BeanConverter INSTANCE = new BeanConverter();
private final CopyOptions copyOptions; private final CopyOptions copyOptions;

View File

@ -20,6 +20,7 @@ import cn.hutool.v7.core.convert.AbstractConverter;
import cn.hutool.v7.core.classloader.ClassLoaderUtil; import cn.hutool.v7.core.classloader.ClassLoaderUtil;
import cn.hutool.v7.core.convert.MatcherConverter; import cn.hutool.v7.core.convert.MatcherConverter;
import java.io.Serial;
import java.lang.reflect.Type; import java.lang.reflect.Type;
/** /**
@ -29,12 +30,13 @@ import java.lang.reflect.Type;
* @author Looly * @author Looly
*/ */
public class ClassConverter extends AbstractConverter implements MatcherConverter { public class ClassConverter extends AbstractConverter implements MatcherConverter {
@Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 单例 * 单例
*/ */
public static ClassConverter INSTANCE = new ClassConverter(); public static final ClassConverter INSTANCE = new ClassConverter();
private final boolean isInitialized; private final boolean isInitialized;

View File

@ -21,6 +21,7 @@ import cn.hutool.v7.core.convert.MatcherConverter;
import cn.hutool.v7.core.reflect.TypeReference; import cn.hutool.v7.core.reflect.TypeReference;
import cn.hutool.v7.core.reflect.TypeUtil; import cn.hutool.v7.core.reflect.TypeUtil;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.Collection; import java.util.Collection;
@ -32,12 +33,13 @@ import java.util.Collection;
* @since 3.0.8 * @since 3.0.8
*/ */
public class CollectionConverter implements MatcherConverter, Serializable { public class CollectionConverter implements MatcherConverter, Serializable {
@Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 单例实体 * 单例实体
*/ */
public static CollectionConverter INSTANCE = new CollectionConverter(); public static final CollectionConverter INSTANCE = new CollectionConverter();
@Override @Override
public boolean match(final Type targetType, final Class<?> rawType, final Object value) { public boolean match(final Type targetType, final Class<?> rawType, final Object value) {

View File

@ -35,7 +35,7 @@ public class BlobStringer implements Function<Object, String> {
/** /**
* 单例 * 单例
*/ */
public static ClobStringer INSTANCE = new ClobStringer(); public static final ClobStringer INSTANCE = new ClobStringer();
@Override @Override

View File

@ -34,7 +34,7 @@ public class ClobStringer implements Function<Object, String> {
/** /**
* 单例 * 单例
*/ */
public static ClobStringer INSTANCE = new ClobStringer(); public static final ClobStringer INSTANCE = new ClobStringer();
@Override @Override
public String apply(final Object o) { public String apply(final Object o) {

View File

@ -32,7 +32,7 @@ public class DefaultRegexDateParser implements PredicateDateParser {
/** /**
* 默认实例 * 默认实例
*/ */
public static DefaultRegexDateParser INSTANCE = new DefaultRegexDateParser(); public static final DefaultRegexDateParser INSTANCE = new DefaultRegexDateParser();
private final RegexDateParser parser; private final RegexDateParser parser;

View File

@ -34,7 +34,7 @@ public class DelVisitor extends SimpleFileVisitor<Path> {
/** /**
* 单例对象 * 单例对象
*/ */
public static DelVisitor INSTANCE = new DelVisitor(); public static final DelVisitor INSTANCE = new DelVisitor();
@Override @Override
public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {

View File

@ -17,7 +17,6 @@
package cn.hutool.v7.core.math; package cn.hutool.v7.core.math;
import cn.hutool.v7.core.array.ArrayUtil; import cn.hutool.v7.core.array.ArrayUtil;
import cn.hutool.v7.core.lang.Console;
import cn.hutool.v7.core.text.CharUtil; import cn.hutool.v7.core.text.CharUtil;
import cn.hutool.v7.core.text.StrUtil; import cn.hutool.v7.core.text.StrUtil;

View File

@ -17,7 +17,6 @@
package cn.hutool.v7.core.net.url; package cn.hutool.v7.core.net.url;
import cn.hutool.v7.core.convert.ConvertUtil; import cn.hutool.v7.core.convert.ConvertUtil;
import cn.hutool.v7.core.lang.Console;
import cn.hutool.v7.core.map.MapUtil; import cn.hutool.v7.core.map.MapUtil;
import cn.hutool.v7.core.text.StrUtil; import cn.hutool.v7.core.text.StrUtil;
import cn.hutool.v7.core.util.CharsetUtil; import cn.hutool.v7.core.util.CharsetUtil;

View File

@ -563,7 +563,7 @@ public class BeanUtilTest {
this.openid = openid; this.openid = openid;
} }
public String name; public final String name;
public int age; public int age;
public String openid; public String openid;
} }

View File

@ -16,14 +16,14 @@
package cn.hutool.v7.core.func; package cn.hutool.v7.core.func;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.SneakyThrows;
import cn.hutool.v7.core.collection.ListUtil; import cn.hutool.v7.core.collection.ListUtil;
import cn.hutool.v7.core.exception.ExceptionUtil; import cn.hutool.v7.core.exception.ExceptionUtil;
import cn.hutool.v7.core.reflect.ConstructorUtil; import cn.hutool.v7.core.reflect.ConstructorUtil;
import cn.hutool.v7.core.reflect.lookup.LookupUtil; import cn.hutool.v7.core.reflect.lookup.LookupUtil;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.SneakyThrows;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -73,7 +73,7 @@ public class LambdaFactoryTest {
final BiConsumer<Something, String> set = LambdaFactory.build(BiConsumer.class, Something.class, "setName", String.class); final BiConsumer<Something, String> set = LambdaFactory.build(BiConsumer.class, Something.class, "setName", String.class);
set.accept(something, name); set.accept(something, name);
Assertions.assertEquals(something.getName(), name); Assertions.assertEquals(name, something.getName());
} }
@Data @Data
@ -87,7 +87,6 @@ public class LambdaFactoryTest {
* *
* @author nasodaengineer * @author nasodaengineer
*/ */
@Disabled
public static class PerformanceTest { public static class PerformanceTest {
public int count; public int count;

View File

@ -16,7 +16,6 @@
package cn.hutool.v7.core.map; package cn.hutool.v7.core.map;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.util.Map; import java.util.Map;

View File

@ -17,6 +17,7 @@
package cn.hutool.v7.core.map; package cn.hutool.v7.core.map;
import cn.hutool.v7.core.map.multi.DirectedWeightGraph; import cn.hutool.v7.core.map.multi.DirectedWeightGraph;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -56,16 +57,8 @@ public class DirectedWeightGraphTest {
graph.removePoint("X"); graph.removePoint("X");
System.out.println(graph); Assertions.assertThrows(DirectedWeightGraph.NegativeRingException.class, ()->{
Map<String, DirectedWeightGraph.Path<String>> map = null; graph.bestPathMap("A");
try { });
map = graph.bestPathMap("A");
map.forEach((k, v) -> {
System.out.println(v);
});
} catch (final DirectedWeightGraph.NegativeRingException e) {
e.printStackTrace();
}
} }
} }

View File

@ -21,7 +21,6 @@ import org.junit.jupiter.api.Test;
/** /**
* @author 温良恭 * @author 温良恭
* @Date 2024/8/21 22:04
*/ */
public class BitStatusUtilTest { public class BitStatusUtilTest {
@ -32,9 +31,9 @@ public class BitStatusUtilTest {
states = BitStatusUtil.add(states, 2); // 添加已读状态 states = BitStatusUtil.add(states, 2); // 添加已读状态
states = BitStatusUtil.add(states, 4); // 添加已写状态 states = BitStatusUtil.add(states, 4); // 添加已写状态
// 此时states 的值为 6二进制为 110这表示同时具有已读已写状态 // 此时states 的值为 6二进制为 110这表示同时具有已读已写状态
boolean hasRead = BitStatusUtil.has(states, 2); // 检查已读状态 final boolean hasRead = BitStatusUtil.has(states, 2); // 检查已读状态
boolean hasWrite = BitStatusUtil.has(states, 4); // 检查已写状态 final boolean hasWrite = BitStatusUtil.has(states, 4); // 检查已写状态
Assertions.assertEquals(true, hasRead); Assertions.assertTrue(hasRead);
Assertions.assertEquals(true, hasWrite); Assertions.assertTrue(hasWrite);
} }
} }

View File

@ -31,7 +31,6 @@ import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class FieldUtilTest { public class FieldUtilTest {
@Test @Test

View File

@ -16,7 +16,6 @@
package cn.hutool.v7.core.text.finder; package cn.hutool.v7.core.text.finder;
import cn.hutool.v7.core.lang.Console;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;

View File

@ -17,13 +17,12 @@
package cn.hutool.v7.core.util; package cn.hutool.v7.core.util;
import cn.hutool.v7.core.collection.set.ConcurrentHashSet; import cn.hutool.v7.core.collection.set.ConcurrentHashSet;
import cn.hutool.v7.core.data.id.UUID; import cn.hutool.v7.core.data.id.IdUtil;
import cn.hutool.v7.core.data.id.Snowflake;
import cn.hutool.v7.core.date.DateUtil; import cn.hutool.v7.core.date.DateUtil;
import cn.hutool.v7.core.date.StopWatch; import cn.hutool.v7.core.date.StopWatch;
import cn.hutool.v7.core.exception.HutoolException; import cn.hutool.v7.core.exception.HutoolException;
import cn.hutool.v7.core.lang.Console; import cn.hutool.v7.core.lang.Console;
import cn.hutool.v7.core.data.id.IdUtil;
import cn.hutool.v7.core.data.id.Snowflake;
import cn.hutool.v7.core.thread.ThreadUtil; import cn.hutool.v7.core.thread.ThreadUtil;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
@ -35,7 +34,6 @@ import java.util.Set;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertTrue;
/** /**
* {@link IdUtil} 单元测试 * {@link IdUtil} 单元测试
@ -47,19 +45,19 @@ public class IdUtilTest {
@Test @Test
public void randomUUIDTest() { public void randomUUIDTest() {
final String simpleUUID = IdUtil.simpleUUID(); final String simpleUUID = IdUtil.simpleUUID();
Assertions.assertEquals(32, simpleUUID.length()); assertEquals(32, simpleUUID.length());
final String randomUUID = IdUtil.randomUUID(); final String randomUUID = IdUtil.randomUUID();
Assertions.assertEquals(36, randomUUID.length()); assertEquals(36, randomUUID.length());
} }
@Test @Test
public void fastUUIDTest() { public void fastUUIDTest() {
final String simpleUUID = IdUtil.fastSimpleUUID(); final String simpleUUID = IdUtil.fastSimpleUUID();
Assertions.assertEquals(32, simpleUUID.length()); assertEquals(32, simpleUUID.length());
final String randomUUID = IdUtil.fastUUID(); final String randomUUID = IdUtil.fastUUID();
Assertions.assertEquals(36, randomUUID.length()); assertEquals(36, randomUUID.length());
} }
/** /**
@ -88,14 +86,14 @@ public class IdUtilTest {
@Test @Test
public void objectIdTest() { public void objectIdTest() {
final String id = IdUtil.objectId(); final String id = IdUtil.objectId();
Assertions.assertEquals(24, id.length()); assertEquals(24, id.length());
} }
@Test @Test
public void getSnowflakeTest() { public void getSnowflakeTest() {
final Snowflake snowflake = IdUtil.getSnowflake(1, 1); final Snowflake snowflake = IdUtil.getSnowflake(1, 1);
final long id = snowflake.next(); final long id = snowflake.next();
Assertions.assertTrue(id > 0); assertTrue(id > 0);
} }
@Test @Test
@ -126,7 +124,7 @@ public class IdUtilTest {
} catch (final InterruptedException e) { } catch (final InterruptedException e) {
throw new HutoolException(e); throw new HutoolException(e);
} }
Assertions.assertEquals(threadCount * idCountPerThread, set.size()); assertEquals(threadCount * idCountPerThread, set.size());
} }
@Test @Test
@ -156,14 +154,14 @@ public class IdUtilTest {
} catch (final InterruptedException e) { } catch (final InterruptedException e) {
throw new HutoolException(e); throw new HutoolException(e);
} }
Assertions.assertEquals(threadCount * idCountPerThread, set.size()); assertEquals(threadCount * idCountPerThread, set.size());
} }
@Test @Test
public void getDataCenterIdTest() { public void getDataCenterIdTest() {
//按照mac地址算法拼接的算法maxDatacenterId应该是0xffffffffL>>6-1此处暂时按照0x7fffffffffffffffL-1防止最后取模溢出 //按照mac地址算法拼接的算法maxDatacenterId应该是0xffffffffL>>6-1此处暂时按照0x7fffffffffffffffL-1防止最后取模溢出
final long dataCenterId = IdUtil.getDataCenterId(Long.MAX_VALUE); final long dataCenterId = IdUtil.getDataCenterId(Long.MAX_VALUE);
Assertions.assertTrue(dataCenterId >= 0); assertTrue(dataCenterId >= 0);
} }

View File

@ -17,10 +17,10 @@
package cn.hutool.v7.cron; package cn.hutool.v7.cron;
import cn.hutool.v7.core.date.DateUnit; import cn.hutool.v7.core.date.DateUnit;
import cn.hutool.v7.core.lang.Console;
import cn.hutool.v7.core.thread.ThreadUtil; import cn.hutool.v7.core.thread.ThreadUtil;
import cn.hutool.v7.log.Log; import cn.hutool.v7.log.Log;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -30,6 +30,7 @@ import java.io.Serializable;
* *
*/ */
public class CronTimer extends Thread implements Serializable { public class CronTimer extends Thread implements Serializable {
@Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final Log log = Log.get(); private static final Log log = Log.get();

View File

@ -217,6 +217,7 @@ public class CronUtil {
* 验证是否为合法的Cron表达式 * 验证是否为合法的Cron表达式
* *
* @param expression 表达式 * @param expression 表达式
* @return 是否为合法Cron表达式
*/ */
public static boolean isValidExpression(final String expression) { public static boolean isValidExpression(final String expression) {
if (expression == null) { if (expression == null) {

View File

@ -16,7 +16,6 @@
package cn.hutool.v7.db.config; package cn.hutool.v7.db.config;
import cn.hutool.v7.db.Db;
import cn.hutool.v7.db.dialect.Dialect; import cn.hutool.v7.db.dialect.Dialect;
import cn.hutool.v7.db.driver.DriverUtil; import cn.hutool.v7.db.driver.DriverUtil;
import cn.hutool.v7.db.ds.DSFactory; import cn.hutool.v7.db.ds.DSFactory;

View File

@ -38,7 +38,7 @@ public class DriverIdentifier implements DriverNames {
/** /**
* 单例驱动识别器 * 单例驱动识别器
*/ */
public static DriverIdentifier INSTANCE = new DriverIdentifier(null); public static final DriverIdentifier INSTANCE = new DriverIdentifier(null);
private final List<DriverMatcher> matcherList; private final List<DriverMatcher> matcherList;

View File

@ -18,6 +18,7 @@ package cn.hutool.v7.db.meta;
import cn.hutool.v7.db.DbException; import cn.hutool.v7.db.DbException;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
@ -29,6 +30,7 @@ import java.sql.SQLException;
* @since 5.7.23 * @since 5.7.23
*/ */
public class ColumnIndex implements Serializable, Cloneable { public class ColumnIndex implements Serializable, Cloneable {
@Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
@ -67,20 +69,44 @@ public class ColumnIndex implements Serializable, Cloneable {
this.ascOrDesc = ascOrDesc; this.ascOrDesc = ascOrDesc;
} }
/**
* 获取索引列名
*
* @return 索引列名
*/
public String getColumnName() { public String getColumnName() {
return columnName; return columnName;
} }
public void setColumnName(final String columnName) { /**
* 设置索引列名
*
* @param columnName 索引列名
* @return this
*/
public ColumnIndex setColumnName(final String columnName) {
this.columnName = columnName; this.columnName = columnName;
return this;
} }
/**
* 获取索引列排序顺序
*
* @return 索引列排序顺序
*/
public String getAscOrDesc() { public String getAscOrDesc() {
return ascOrDesc; return ascOrDesc;
} }
public void setAscOrDesc(final String ascOrDesc) { /**
* 设置索引列排序顺序
*
* @param ascOrDesc 索引列排序顺序
* @return this
*/
public ColumnIndex setAscOrDesc(final String ascOrDesc) {
this.ascOrDesc = ascOrDesc; this.ascOrDesc = ascOrDesc;
return this;
} }
@Override @Override

View File

@ -107,68 +107,164 @@ public class CpuInfo {
this.cpuModel = cpuModel; this.cpuModel = cpuModel;
} }
/**
* 获取CPU核心数
*
* @return CPU核心数
*/
public Integer getCpuNum() { public Integer getCpuNum() {
return cpuNum; return cpuNum;
} }
public void setCpuNum(final Integer cpuNum) { /**
* 设置CPU核心数
*
* @param cpuNum CPU核心数
* @return this
*/
public CpuInfo setCpuNum(final Integer cpuNum) {
this.cpuNum = cpuNum; this.cpuNum = cpuNum;
return this;
} }
/**
* 获取CPU总使用率
*
* @return CPU总使用率
*/
public double getToTal() { public double getToTal() {
return toTal; return toTal;
} }
public void setToTal(final double toTal) { /**
* 设置CPU总使用率
*
* @param toTal CPU总使用率
* @return this
*/
public CpuInfo setToTal(final double toTal) {
this.toTal = toTal; this.toTal = toTal;
return this;
} }
/**
* 获取CPU系统使用率
*
* @return CPU系统使用率
*/
public double getSys() { public double getSys() {
return sys; return sys;
} }
public void setSys(final double sys) { /**
* 设置CPU系统使用率
*
* @param sys CPU系统使用率
* @return this
*/
public CpuInfo setSys(final double sys) {
this.sys = sys; this.sys = sys;
return this;
} }
/**
* 获取CPU用户使用率
*
* @return CPU用户使用率
*/
public double getUser() { public double getUser() {
return user; return user;
} }
public void setUser(final double user) { /**
* 设置CPU用户使用率
*
* @param user CPU用户使用率
* @return this
*/
public CpuInfo setUser(final double user) {
this.user = user; this.user = user;
return this;
} }
/**
* 获取CPU当前等待率
*
* @return CPU当前等待率
*/
public double getWait() { public double getWait() {
return wait; return wait;
} }
public void setWait(final double wait) { /**
* 设置CPU当前等待率
*
* @param wait CPU当前等待率
* @return this
*/
public CpuInfo setWait(final double wait) {
this.wait = wait; this.wait = wait;
return this;
} }
/**
* 获取CPU当前空闲率
*
* @return CPU当前空闲率
*/
public double getFree() { public double getFree() {
return free; return free;
} }
public void setFree(final double free) { /**
* 设置CPU当前空闲率
*
* @param free CPU当前空闲率
* @return this
*/
public CpuInfo setFree(final double free) {
this.free = free; this.free = free;
return this;
} }
/**
* 获取CPU型号信息
*
* @return CPU型号信息
*/
public String getCpuModel() { public String getCpuModel() {
return cpuModel; return cpuModel;
} }
public void setCpuModel(final String cpuModel) { /**
* 设置CPU型号信息
*
* @param cpuModel CPU型号信息
* @return this
*/
public CpuInfo setCpuModel(final String cpuModel) {
this.cpuModel = cpuModel; this.cpuModel = cpuModel;
return this;
} }
/**
* 获取CPU ticks
*
* @return CPU ticks
*/
public CpuTicks getTicks() { public CpuTicks getTicks() {
return ticks; return ticks;
} }
public void setTicks(final CpuTicks ticks) { /**
* 设置CPU ticks
*
* @param ticks CPU ticks
* @return this
*/
public CpuInfo setTicks(final CpuTicks ticks) {
this.ticks = ticks; this.ticks = ticks;
return this;
} }
/** /**
@ -183,15 +279,15 @@ public class CpuInfo {
@Override @Override
public String toString() { public String toString() {
return "CpuInfo{" + return "CpuInfo{" +
"CPU核心数=" + cpuNum + "CPU核心数=" + cpuNum +
", CPU总的使用率=" + toTal + ", CPU总的使用率=" + toTal +
", CPU系统使用率=" + sys + ", CPU系统使用率=" + sys +
", CPU用户使用率=" + user + ", CPU用户使用率=" + user +
", CPU当前等待率=" + wait + ", CPU当前等待率=" + wait +
", CPU当前空闲率=" + free + ", CPU当前空闲率=" + free +
", CPU利用率=" + getUsed() + ", CPU利用率=" + getUsed() +
", CPU型号信息='" + cpuModel + '\'' + ", CPU型号信息='" + cpuModel + '\'' +
'}'; '}';
} }
/** /**

View File

@ -21,10 +21,7 @@ import cn.hutool.v7.core.io.IoUtil;
import cn.hutool.v7.extra.template.Template; import cn.hutool.v7.extra.template.Template;
import cn.hutool.v7.extra.template.TemplateException; import cn.hutool.v7.extra.template.TemplateException;
import java.io.IOException; import java.io.*;
import java.io.OutputStream;
import java.io.Serializable;
import java.io.Writer;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.Map; import java.util.Map;
@ -34,6 +31,7 @@ import java.util.Map;
* @author Looly * @author Looly
*/ */
public class FreemarkerTemplate implements Template, Serializable{ public class FreemarkerTemplate implements Template, Serializable{
@Serial
private static final long serialVersionUID = -8157926902932567280L; private static final long serialVersionUID = -8157926902932567280L;
freemarker.template.Template rawTemplate; freemarker.template.Template rawTemplate;

View File

@ -112,37 +112,73 @@ public class BeanValidationResult {
*/ */
private Object value; private Object value;
/**
* 获取属性字段名称
*
* @return 属性字段名称
*/
public String getPropertyName() { public String getPropertyName() {
return propertyName; return propertyName;
} }
public void setPropertyName(final String propertyName) { /**
* 设置属性字段名称
*
* @param propertyName 属性字段名称
* @return this
*/
public ErrorMessage setPropertyName(final String propertyName) {
this.propertyName = propertyName; this.propertyName = propertyName;
return this;
} }
/**
* 获取错误信息
*
* @return 错误信息
*/
public String getMessage() { public String getMessage() {
return message; return message;
} }
public void setMessage(final String message) { /**
* 设置错误信息
*
* @param message 错误信息
* @return this
*/
public ErrorMessage setMessage(final String message) {
this.message = message; this.message = message;
return this;
} }
/**
* 获取错误值
*
* @return 错误值
*/
public Object getValue() { public Object getValue() {
return value; return value;
} }
public void setValue(final Object value) { /**
* 设置错误值
*
* @param value 错误值
* @return this
*/
public ErrorMessage setValue(final Object value) {
this.value = value; this.value = value;
return this;
} }
@Override @Override
public String toString() { public String toString() {
return "ErrorMessage{" + return "ErrorMessage{" +
"propertyName='" + propertyName + '\'' + "propertyName='" + propertyName + '\'' +
", message='" + message + '\'' + ", message='" + message + '\'' +
", value=" + value + ", value=" + value +
'}'; '}';
} }
} }
} }

View File

@ -16,4 +16,4 @@
cn.hutool.v7.extra.mq.engine.kafka.KafkaEngine cn.hutool.v7.extra.mq.engine.kafka.KafkaEngine
cn.hutool.v7.extra.mq.engine.rabbitmq.RabbitMQEngine cn.hutool.v7.extra.mq.engine.rabbitmq.RabbitMQEngine
cn.hutool.v7.extra.mq.engine.activemq.ActiveMQ5Engine cn.hutool.v7.extra.mq.engine.rocketmq.RocketMQEngine

View File

@ -44,7 +44,7 @@ public class ClassicHttpRequestBuilder implements EngineRequestBuilder<ClassicHt
/** /**
* 单例 * 单例
*/ */
public static ClassicHttpRequestBuilder INSTANCE = new ClassicHttpRequestBuilder(); public static final ClassicHttpRequestBuilder INSTANCE = new ClassicHttpRequestBuilder();
@Override @Override
public ClassicHttpRequest build(final Request message) { public ClassicHttpRequest build(final Request message) {

View File

@ -38,8 +38,8 @@ public class IssueIB9MH0Test {
_01("tab_people_home","首页"), _01("tab_people_home","首页"),
_02("tab_people_hospital","医院"); _02("tab_people_hospital","医院");
private String code; private final String code;
private String title; private final String title;
TabTypeEnum(final String code, final String title) { TabTypeEnum(final String code, final String title) {
this.code = code; this.code = code;

View File

@ -17,7 +17,6 @@
package cn.hutool.v7.poi.excel.writer; package cn.hutool.v7.poi.excel.writer;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import cn.hutool.v7.core.map.BeanMap;
import java.util.Map; import java.util.Map;