mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix code
This commit is contained in:
parent
e483ed9938
commit
06e091fc4a
@ -356,7 +356,7 @@ public class ArrayUtil extends PrimitiveArrayUtil {
|
||||
/**
|
||||
* 返回数组中第一个匹配规则的值的位置
|
||||
*
|
||||
* @param <T> 数组元素类型
|
||||
* @param <E> 数组元素类型
|
||||
* @param matcher 匹配接口,实现此接口自定义匹配规则
|
||||
* @param beginIndexInclude 检索开始的位置,不能为负数
|
||||
* @param array 数组
|
||||
@ -364,11 +364,12 @@ public class ArrayUtil extends PrimitiveArrayUtil {
|
||||
* @since 5.7.3
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> int matchIndex(final int beginIndexInclude, final Predicate<T> matcher, final T... array) {
|
||||
public static <E> int matchIndex(final int beginIndexInclude, final Predicate<E> matcher, final E... array) {
|
||||
if (isEmpty(array)) {
|
||||
return INDEX_NOT_FOUND;
|
||||
}
|
||||
return ArrayWrapper.of(array).matchIndex(beginIndexInclude, matcher);
|
||||
final ArrayWrapper<E[], E> arrayWrapper = ArrayWrapper.of(array);
|
||||
return arrayWrapper.matchIndex(beginIndexInclude, matcher);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -590,7 +591,7 @@ public class ArrayUtil extends PrimitiveArrayUtil {
|
||||
* @return 新数组或原有数组
|
||||
* @since 5.7.23
|
||||
*/
|
||||
public static <A> A replace(final A array, final int index, final Object values) {
|
||||
public static <A> A replace(final A array, final int index, final A values) {
|
||||
if (isEmpty(array)) {
|
||||
return ofArray(values, null == array ? null : array.getClass().getComponentType());
|
||||
}
|
||||
@ -1174,14 +1175,15 @@ public class ArrayUtil extends PrimitiveArrayUtil {
|
||||
* 获取数组对象中指定index的值,支持负数,例如-1表示倒数第一个值<br>
|
||||
* 如果数组下标越界,返回null
|
||||
*
|
||||
* @param <T> 数组元素类型
|
||||
* @param <E> 数组元素类型
|
||||
* @param array 数组对象
|
||||
* @param index 下标,支持负数
|
||||
* @return 值
|
||||
* @since 4.0.6
|
||||
*/
|
||||
public static <T> T get(final Object array, final int index) {
|
||||
return ArrayWrapper.of(array).get(index);
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <E> E get(final Object array, final int index) {
|
||||
return (E) ArrayWrapper.of(array).get(index);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.dromara.hutool.core.array;
|
||||
|
||||
import org.dromara.hutool.core.collection.iter.ArrayIter;
|
||||
import org.dromara.hutool.core.convert.Convert;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.func.Wrapper;
|
||||
@ -8,6 +9,7 @@ import org.dromara.hutool.core.util.ObjUtil;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
@ -15,12 +17,13 @@ import java.util.function.UnaryOperator;
|
||||
* 数组包装,提供一系列数组方法
|
||||
*
|
||||
* @param <A> 数组类型
|
||||
* @param <E> 数组元素类型
|
||||
* @author looly
|
||||
* @since 6.0.0
|
||||
*/
|
||||
public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
public class ArrayWrapper<A, E> implements Wrapper<A>, Iterable<E> {
|
||||
|
||||
private final Class<?> componentType;
|
||||
private final Class<E> componentType;
|
||||
private A array;
|
||||
private int length;
|
||||
|
||||
@ -33,8 +36,8 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* @return ArrayWrapper
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <A> ArrayWrapper<A> of(final Class<?> componentType, final int length) {
|
||||
return (ArrayWrapper<A>) of(Array.newInstance(componentType, length));
|
||||
public static <A, E> ArrayWrapper<A, E> of(final Class<E> componentType, final int length) {
|
||||
return (ArrayWrapper<A, E>) of(Array.newInstance(componentType, length));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -42,9 +45,10 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
*
|
||||
* @param array 数组(非空)
|
||||
* @param <A> 数组类型
|
||||
* @param <E> 元素类型
|
||||
* @return ArrayWrapper
|
||||
*/
|
||||
public static <A> ArrayWrapper<A> of(final A array) {
|
||||
public static <A, E> ArrayWrapper<A, E> of(final A array) {
|
||||
return new ArrayWrapper<>(array);
|
||||
}
|
||||
|
||||
@ -53,12 +57,13 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
*
|
||||
* @param array 数组对象(非空)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public ArrayWrapper(final A array) {
|
||||
Assert.notNull(array, "Array must be not null!");
|
||||
if (!ArrayUtil.isArray(array)) {
|
||||
throw new IllegalArgumentException("Object is not a array!");
|
||||
}
|
||||
this.componentType = array.getClass().getComponentType();
|
||||
this.componentType = (Class<E>) array.getClass().getComponentType();
|
||||
setNewArray(array);
|
||||
}
|
||||
|
||||
@ -124,12 +129,11 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* 获取数组对象中指定index的值,支持负数,例如-1表示倒数第一个值<br>
|
||||
* 如果数组下标越界,返回null
|
||||
*
|
||||
* @param <E> 数组元素类型
|
||||
* @param index 下标,支持负数,-1表示最后一个元素
|
||||
* @return 值
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public <E> E get(int index) {
|
||||
public E get(int index) {
|
||||
final int length = this.length;
|
||||
if (index < 0) {
|
||||
index += length;
|
||||
@ -145,21 +149,19 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
/**
|
||||
* 返回数组中第一个非空元素
|
||||
*
|
||||
* @param <E> 数组元素类型
|
||||
* @return 第一个非空元素,如果 不存在非空元素 或 数组为空,返回{@code null}
|
||||
*/
|
||||
public <E> E firstNonNull() {
|
||||
public E firstNonNull() {
|
||||
return firstMatch(ObjUtil::isNotNull);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回数组中第一个匹配规则的值
|
||||
*
|
||||
* @param <E> 元素类型
|
||||
* @param matcher 匹配接口,实现此接口自定义匹配规则
|
||||
* @return 第一个匹配元素,如果 不存在匹配元素 或 数组为空,返回 {@code null}
|
||||
*/
|
||||
public <E> E firstMatch(final Predicate<?> matcher) {
|
||||
public E firstMatch(final Predicate<E> matcher) {
|
||||
final int index = matchIndex(matcher);
|
||||
if (index == ArrayUtil.INDEX_NOT_FOUND) {
|
||||
return null;
|
||||
@ -184,7 +186,7 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* @param matcher 匹配接口,实现此接口自定义匹配规则
|
||||
* @return 第一个匹配元素的位置,{@link ArrayUtil#INDEX_NOT_FOUND}表示未匹配到
|
||||
*/
|
||||
public int matchIndex(final Predicate<?> matcher) {
|
||||
public int matchIndex(final Predicate<E> matcher) {
|
||||
return matchIndex(0, matcher);
|
||||
}
|
||||
|
||||
@ -206,7 +208,7 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* @param offset 检索开始的位置,不能为负数
|
||||
* @return 第一个匹配元素的位置,{@link ArrayUtil#INDEX_NOT_FOUND}表示未匹配到
|
||||
*/
|
||||
public int matchIndex(final int offset, final Predicate<?> matcher) {
|
||||
public int matchIndex(final int offset, final Predicate<E> matcher) {
|
||||
if (null == matcher && offset < this.length) {
|
||||
return offset;
|
||||
}
|
||||
@ -238,7 +240,7 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* @param matcher 匹配接口,实现此接口自定义匹配规则
|
||||
* @return 最后一个匹配元素的位置,{@link ArrayUtil#INDEX_NOT_FOUND}表示未匹配到
|
||||
*/
|
||||
public int matchLastIndex(final Predicate<?> matcher) {
|
||||
public int matchLastIndex(final Predicate<E> matcher) {
|
||||
return matchLastIndex(length - 1, matcher);
|
||||
}
|
||||
|
||||
@ -249,7 +251,7 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* @param offset 从后向前查找时的起始位置,一般为{@code array.length - 1}
|
||||
* @return 最后一个匹配元素的位置,{@link ArrayUtil#INDEX_NOT_FOUND}表示未匹配到
|
||||
*/
|
||||
public int matchLastIndex(final int offset, final Predicate<?> matcher) {
|
||||
public int matchLastIndex(final int offset, final Predicate<E> matcher) {
|
||||
if (null == matcher && offset >= 0) {
|
||||
return offset;
|
||||
}
|
||||
@ -270,7 +272,7 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* @param value 新元素或新数组
|
||||
* @return this
|
||||
*/
|
||||
public ArrayWrapper<A> setOrAppend(final int index, final Object value) {
|
||||
public ArrayWrapper<A, E> setOrAppend(final int index, final E value) {
|
||||
if (index < this.length) {
|
||||
Array.set(array, index, value);
|
||||
} else {
|
||||
@ -284,11 +286,22 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* 将新元素添加到已有数组中<br>
|
||||
* 添加新元素会生成一个新的数组,不影响原数组
|
||||
*
|
||||
* @param newElements 新元素或新数组
|
||||
* @param element 新元素或新数组
|
||||
* @return 新数组
|
||||
*/
|
||||
public ArrayWrapper<A> append(final Object newElements) {
|
||||
return insert(this.length, newElements);
|
||||
public ArrayWrapper<A, E> append(final E element) {
|
||||
return insert(this.length, element);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将新数组追加到已有数组中<br>
|
||||
* 追加新数组会生成一个新的数组,不影响原数组
|
||||
*
|
||||
* @param array 需要追加的数组数组
|
||||
* @return 新数组
|
||||
*/
|
||||
public ArrayWrapper<A, E> appendArray(final A array) {
|
||||
return insertArray(this.length, array);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -296,22 +309,29 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* 如果插入位置为负数,从原数组从后向前计数,若大于原数组长度,则空白处用默认值填充<br>
|
||||
*
|
||||
* @param index 插入位置,支持负数。此位置为对应此位置元素之前的空档
|
||||
* @param arrayToAppend 新元素
|
||||
* @param element 元素
|
||||
* @return 新数组
|
||||
*/
|
||||
public ArrayWrapper<A, E> insert(final int index, final E element) {
|
||||
return insertArray(index, createSingleElementArray(element));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将新元素插入到已有数组中的某个位置
|
||||
* 如果插入位置为负数,从原数组从后向前计数,若大于原数组长度,则空白处用默认值填充<br>
|
||||
*
|
||||
* @param index 插入位置,支持负数。此位置为对应此位置元素之前的空档
|
||||
* @param arrayToInsert 新元素数组
|
||||
* @return 新数组
|
||||
*/
|
||||
@SuppressWarnings({"unchecked", "SuspiciousSystemArraycopy"})
|
||||
public ArrayWrapper<A> insert(int index, Object arrayToAppend) {
|
||||
if (!ArrayUtil.isArray(arrayToAppend)) {
|
||||
// 用户传入单个元素则创建单元素数组
|
||||
arrayToAppend = createSingleElementArray(arrayToAppend);
|
||||
}
|
||||
|
||||
final int appendLength = ArrayUtil.length(arrayToAppend);
|
||||
public ArrayWrapper<A, E> insertArray(int index, A arrayToInsert) {
|
||||
final int appendLength = ArrayUtil.length(arrayToInsert);
|
||||
if (0 == appendLength) {
|
||||
return this;
|
||||
}
|
||||
if (isEmpty()) {
|
||||
setNewArray((A) Convert.convert(array.getClass(), arrayToAppend));
|
||||
setNewArray((A) Convert.convert(array.getClass(), arrayToInsert));
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -323,14 +343,14 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
// 已有数组的元素类型
|
||||
// 如果 已有数组的元素类型是 原始类型,则需要转换 新元素数组 为该类型,避免ArrayStoreException
|
||||
if (this.componentType.isPrimitive()) {
|
||||
arrayToAppend = Convert.convert(array.getClass(), arrayToAppend);
|
||||
arrayToInsert = (A) Convert.convert(array.getClass(), arrayToInsert);
|
||||
}
|
||||
|
||||
final A result = (A) Array.newInstance(this.componentType, Math.max(len, index) + appendLength);
|
||||
// 原数组到index位置
|
||||
System.arraycopy(array, 0, result, 0, Math.min(len, index));
|
||||
// 新增的数组追加
|
||||
System.arraycopy(arrayToAppend, 0, result, index, appendLength);
|
||||
System.arraycopy(arrayToInsert, 0, result, index, appendLength);
|
||||
if (index < len) {
|
||||
// 原数组剩余部分
|
||||
System.arraycopy(array, index, result, index + appendLength, len - index);
|
||||
@ -350,16 +370,11 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* </ul>
|
||||
*
|
||||
* @param index 位置
|
||||
* @param values 新值
|
||||
* @param values 新值或新数组
|
||||
* @return this
|
||||
*/
|
||||
@SuppressWarnings({"unchecked", "SuspiciousSystemArraycopy"})
|
||||
public ArrayWrapper<A> replace(final int index, Object values) {
|
||||
if (!ArrayUtil.isArray(values)) {
|
||||
// 用户传入单个元素则创建单元素数组
|
||||
values = createSingleElementArray(values);
|
||||
}
|
||||
|
||||
public ArrayWrapper<A, E> replace(final int index, final A values) {
|
||||
final int valuesLength = ArrayUtil.length(values);
|
||||
if (0 == valuesLength) {
|
||||
return this;
|
||||
@ -369,11 +384,11 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
}
|
||||
if (index < 0) {
|
||||
// 从头部追加
|
||||
return insert(0, values);
|
||||
return insertArray(0, values);
|
||||
}
|
||||
if (index >= length) {
|
||||
// 超出长度,尾部追加
|
||||
return append(values);
|
||||
return appendArray(values);
|
||||
}
|
||||
|
||||
// 在原数组范围内
|
||||
@ -397,7 +412,7 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* @param editor 编辑器接口,为 {@code null}则返回原数组
|
||||
* @return this
|
||||
*/
|
||||
public ArrayWrapper<A> edit(final UnaryOperator<?> editor) {
|
||||
public ArrayWrapper<A, E> edit(final UnaryOperator<E> editor) {
|
||||
if (null == array || null == editor) {
|
||||
return this;
|
||||
}
|
||||
@ -495,7 +510,7 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* @throws NullPointerException 如果数组元素含有null值
|
||||
* @since 6.0.0
|
||||
*/
|
||||
public boolean isSorted(final Comparator<? super A> comparator) {
|
||||
public boolean isSorted(final Comparator<E> comparator) {
|
||||
if (isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
@ -528,7 +543,7 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* @param isDESC 是否反序
|
||||
* @return 是否有序
|
||||
*/
|
||||
public boolean isSorted(final Comparator<? super A> comparator, final boolean isDESC) {
|
||||
public boolean isSorted(final Comparator<E> comparator, final boolean isDESC) {
|
||||
if (null == comparator) {
|
||||
return false;
|
||||
}
|
||||
@ -546,6 +561,11 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<E> iterator() {
|
||||
return new ArrayIter<>(this.array);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final A array = this.array;
|
||||
@ -599,9 +619,10 @@ public class ArrayWrapper<A> implements Wrapper<A> {
|
||||
* @param value 元素值
|
||||
* @return 数组
|
||||
*/
|
||||
private Object createSingleElementArray(final Object value) {
|
||||
@SuppressWarnings("unchecked")
|
||||
private A createSingleElementArray(final E value) {
|
||||
// 插入单个元素
|
||||
final Object newInstance = Array.newInstance(this.componentType, 1);
|
||||
final A newInstance = (A) Array.newInstance(this.componentType, 1);
|
||||
Array.set(newInstance, 0, value);
|
||||
return newInstance;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import org.dromara.hutool.core.math.NumberUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
@ -16,7 +16,7 @@ import org.dromara.hutool.core.codec.binary.Base16Codec;
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.ByteUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
|
||||
import java.awt.Color;
|
||||
|
@ -15,7 +15,7 @@ package org.dromara.hutool.core.codec;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -17,7 +17,7 @@ import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.text.CharPool;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
@ -16,7 +16,7 @@ import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -25,7 +25,7 @@ import org.dromara.hutool.core.io.stream.FastByteArrayOutputStream;
|
||||
import org.dromara.hutool.core.io.stream.LimitedInputStream;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.ByteUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
|
||||
|
@ -14,7 +14,7 @@ package org.dromara.hutool.core.convert;
|
||||
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.reflect.TypeUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Type;
|
||||
|
@ -23,7 +23,7 @@ import org.dromara.hutool.core.reflect.TypeReference;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.text.UnicodeUtil;
|
||||
import org.dromara.hutool.core.util.ByteUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
@ -21,7 +21,7 @@ import org.dromara.hutool.core.reflect.ConstructorUtil;
|
||||
import org.dromara.hutool.core.reflect.TypeReference;
|
||||
import org.dromara.hutool.core.reflect.TypeUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Map;
|
||||
|
@ -10,7 +10,7 @@
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
package org.dromara.hutool.core.data;
|
||||
|
||||
import org.dromara.hutool.core.date.DatePattern;
|
||||
import org.dromara.hutool.core.date.DateTime;
|
||||
@ -19,6 +19,7 @@ import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.regex.PatternPool;
|
||||
import org.dromara.hutool.core.lang.Validator;
|
||||
import org.dromara.hutool.core.regex.ReUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
|
||||
import java.io.Serializable;
|
@ -13,7 +13,7 @@
|
||||
package org.dromara.hutool.core.data;
|
||||
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
/**
|
||||
* 数据脱敏(Data Masking)工具类,对某些敏感信息(比如,身份证号、手机号、卡号、姓名、地址、邮箱等 )屏蔽敏感数据。<br>
|
||||
|
@ -10,7 +10,7 @@
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.lang.id;
|
||||
package org.dromara.hutool.core.data.id;
|
||||
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
@ -10,7 +10,7 @@
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.lang.id;
|
||||
package org.dromara.hutool.core.data.id;
|
||||
|
||||
import org.dromara.hutool.core.util.RandomUtil;
|
||||
|
@ -10,7 +10,7 @@
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.lang.id;
|
||||
package org.dromara.hutool.core.data.id;
|
||||
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.RandomUtil;
|
@ -10,7 +10,7 @@
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.lang.id;
|
||||
package org.dromara.hutool.core.data.id;
|
||||
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
@ -10,7 +10,7 @@
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.lang.id;
|
||||
package org.dromara.hutool.core.data.id;
|
||||
|
||||
import org.dromara.hutool.core.date.SystemClock;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
@ -10,7 +10,7 @@
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.lang.id;
|
||||
package org.dromara.hutool.core.data.id;
|
||||
|
||||
import org.dromara.hutool.core.util.RandomUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
@ -16,4 +16,4 @@
|
||||
* @author looly
|
||||
* @since 5.7.5
|
||||
*/
|
||||
package org.dromara.hutool.core.lang.id;
|
||||
package org.dromara.hutool.core.data.id;
|
@ -13,7 +13,7 @@
|
||||
/**
|
||||
* 数据相关封装和工具类<br>
|
||||
* 在Hutool中,“数据”是指社会属性的内容<br>
|
||||
* 如电话、统一社会信用代码、密码、坐标系、数据脱敏等。
|
||||
* 如ID、电话、统一社会信用代码、密码、坐标系、数据脱敏等。
|
||||
*
|
||||
* @author looly
|
||||
*/
|
||||
|
@ -18,7 +18,7 @@ import org.dromara.hutool.core.date.DateTime;
|
||||
import org.dromara.hutool.core.date.format.DefaultDateBasic;
|
||||
import org.dromara.hutool.core.regex.ReUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
/**
|
||||
* ISO8601日期字符串(JDK的Date对象toString默认格式)解析,支持格式;
|
||||
|
@ -17,7 +17,7 @@ import org.dromara.hutool.core.date.DatePattern;
|
||||
import org.dromara.hutool.core.date.DateTime;
|
||||
import org.dromara.hutool.core.date.format.DefaultDateBasic;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
/**
|
||||
* 标准日期字符串解析,支持格式;
|
||||
|
@ -17,7 +17,7 @@ import org.dromara.hutool.core.map.MapUtil;
|
||||
import org.dromara.hutool.core.reflect.ConstructorUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
@ -14,7 +14,7 @@ package org.dromara.hutool.core.io;
|
||||
|
||||
import org.dromara.hutool.core.collection.iter.ComputeIter;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -14,7 +14,7 @@ package org.dromara.hutool.core.io.buffer;
|
||||
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.ByteUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
@ -17,7 +17,7 @@ import org.dromara.hutool.core.net.url.URLUtil;
|
||||
import org.dromara.hutool.core.regex.ReUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.SystemUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -29,7 +29,7 @@ import org.dromara.hutool.core.regex.ReUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
import org.dromara.hutool.core.util.SystemUtil;
|
||||
|
@ -18,7 +18,7 @@ import org.dromara.hutool.core.io.IORuntimeException;
|
||||
import org.dromara.hutool.core.io.IoUtil;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.func.SerConsumer;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -17,7 +17,7 @@ import org.dromara.hutool.core.io.file.PathUtil;
|
||||
import org.dromara.hutool.core.io.watch.watchers.WatcherChain;
|
||||
import org.dromara.hutool.core.net.url.URLUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
|
@ -13,7 +13,7 @@
|
||||
package org.dromara.hutool.core.lang;
|
||||
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
@ -13,7 +13,7 @@
|
||||
package org.dromara.hutool.core.lang;
|
||||
|
||||
import org.dromara.hutool.core.convert.Convert;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -24,6 +24,11 @@ import java.io.Serializable;
|
||||
*/
|
||||
public interface EnumItem<E extends EnumItem<E>> extends Serializable {
|
||||
|
||||
/**
|
||||
* 枚举名称
|
||||
*
|
||||
* @return 名称
|
||||
*/
|
||||
String name();
|
||||
|
||||
/**
|
||||
@ -35,6 +40,11 @@ public interface EnumItem<E extends EnumItem<E>> extends Serializable {
|
||||
return name();
|
||||
}
|
||||
|
||||
/**
|
||||
* int值
|
||||
*
|
||||
* @return int值
|
||||
*/
|
||||
int intVal();
|
||||
|
||||
/**
|
||||
|
@ -22,7 +22,7 @@ import org.dromara.hutool.core.math.NumberUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
import org.dromara.hutool.core.regex.ReUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.IdcardUtil;
|
||||
import org.dromara.hutool.core.data.IdcardUtil;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.nio.charset.Charset;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package org.dromara.hutool.core.lang.generator;
|
||||
|
||||
import org.dromara.hutool.core.lang.id.ObjectId;
|
||||
import org.dromara.hutool.core.data.id.ObjectId;
|
||||
|
||||
/**
|
||||
* ObjectId生成器
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package org.dromara.hutool.core.lang.generator;
|
||||
|
||||
import org.dromara.hutool.core.lang.id.Snowflake;
|
||||
import org.dromara.hutool.core.data.id.Snowflake;
|
||||
|
||||
/**
|
||||
* Snowflake生成器<br>
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package org.dromara.hutool.core.lang.generator;
|
||||
|
||||
import org.dromara.hutool.core.lang.id.IdUtil;
|
||||
import org.dromara.hutool.core.data.id.IdUtil;
|
||||
|
||||
/**
|
||||
* UUID生成器
|
||||
|
@ -11,9 +11,21 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* 语言特性包,包括大量便捷的数据结构,例如验证器Validator,分布式ID生成器Snowflake等
|
||||
* 语言特性包,包括大量便捷的数据结构,包括:
|
||||
* <ul>
|
||||
* <li>ANSI:ANSI编码</li>
|
||||
* <li>Builder:构建器</li>
|
||||
* <li>Caller:查找调用者</li>
|
||||
* <li>Copier:拷贝(复制)</li>
|
||||
* <li>Generator:生成器</li>
|
||||
* <li>Getter:getXXX抽象</li>
|
||||
* <li>Intern:规范化表示形式</li>
|
||||
* <li>Loader:加载器的抽象</li>
|
||||
* <li>Mutable:可变值对象封装</li>
|
||||
* <li>Range:区间和边界封装</li>
|
||||
* <li>Tuple:元组</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
package org.dromara.hutool.core.lang;
|
||||
|
@ -13,8 +13,8 @@
|
||||
package org.dromara.hutool.core.lang.page;
|
||||
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.lang.DefaultSegment;
|
||||
import org.dromara.hutool.core.lang.Segment;
|
||||
import org.dromara.hutool.core.lang.range.DefaultSegment;
|
||||
import org.dromara.hutool.core.lang.range.Segment;
|
||||
import org.dromara.hutool.core.math.NumberUtil;
|
||||
|
||||
/**
|
||||
|
@ -22,7 +22,8 @@ import java.util.function.Predicate;
|
||||
* 作为{@link Predicate}使用时,可检验指定值是否在区间中,即指定值是否同时满足上下界的{@link Bound#test}方法。
|
||||
*
|
||||
* <p>区间的类型,支持通过工厂方法创建下述几种类型的区间:</p>
|
||||
* <table summary="">
|
||||
* <table>
|
||||
* <caption>区间</caption>
|
||||
* <tr><th>区间 <th>数学定义 <th>工厂方法
|
||||
* <tr><td>{@code (a, b)} <td>{@code {x | a < x < b}} <td>{@link #open}
|
||||
* <tr><td>{@code [a, b]} <td>{@code {x | a <= x <= b}}<td>{@link #close}
|
||||
|
@ -10,7 +10,7 @@
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.lang;
|
||||
package org.dromara.hutool.core.lang.range;
|
||||
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
|
@ -10,9 +10,10 @@
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.lang;
|
||||
package org.dromara.hutool.core.lang.range;
|
||||
|
||||
import org.dromara.hutool.core.convert.Convert;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.math.NumberUtil;
|
||||
|
||||
import java.lang.reflect.Type;
|
@ -14,7 +14,7 @@ package org.dromara.hutool.core.math;
|
||||
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
/**
|
||||
* 数字检查器
|
||||
|
@ -19,7 +19,7 @@ import org.dromara.hutool.core.lang.Singleton;
|
||||
import org.dromara.hutool.core.regex.PatternPool;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.net.Inet4Address;
|
||||
import java.net.InetAddress;
|
||||
|
@ -19,7 +19,7 @@ import org.dromara.hutool.core.io.IORuntimeException;
|
||||
import org.dromara.hutool.core.io.IoUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.JNDIUtil;
|
||||
import org.dromara.hutool.core.util.RandomUtil;
|
||||
|
||||
|
@ -14,7 +14,7 @@ package org.dromara.hutool.core.net.url;
|
||||
|
||||
import org.dromara.hutool.core.io.stream.FastByteArrayOutputStream;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -13,7 +13,7 @@
|
||||
package org.dromara.hutool.core.net.url;
|
||||
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
|
@ -16,7 +16,7 @@ import org.dromara.hutool.core.collection.CollUtil;
|
||||
import org.dromara.hutool.core.collection.ListUtil;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
|
||||
|
@ -17,7 +17,7 @@ import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.map.TripleTable;
|
||||
import org.dromara.hutool.core.text.StrTrimer;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.lang.reflect.Executable;
|
||||
import java.lang.reflect.Method;
|
||||
|
@ -21,7 +21,7 @@ import org.dromara.hutool.core.io.resource.ResourceUtil;
|
||||
import org.dromara.hutool.core.net.url.URLDecoder;
|
||||
import org.dromara.hutool.core.net.url.URLUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
import org.dromara.hutool.core.util.SystemUtil;
|
||||
|
||||
|
@ -23,7 +23,7 @@ import org.dromara.hutool.core.net.url.URLUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -29,7 +29,6 @@ import org.dromara.hutool.core.text.replacer.RangeReplacerByStr;
|
||||
import org.dromara.hutool.core.text.replacer.SearchReplacer;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.core.util.ByteUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
|
||||
|
@ -10,10 +10,7 @@
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.text.ASCIIStrCache;
|
||||
import org.dromara.hutool.core.text.CharPool;
|
||||
package org.dromara.hutool.core.text;
|
||||
|
||||
/**
|
||||
* 字符工具类<br>
|
@ -12,8 +12,6 @@
|
||||
|
||||
package org.dromara.hutool.core.text;
|
||||
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
|
||||
/**
|
||||
* 命名规则封装,主要是针对驼峰风格命名、连接符命名等的封装
|
||||
*
|
||||
|
@ -12,8 +12,6 @@
|
||||
|
||||
package org.dromara.hutool.core.text;
|
||||
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
@ -14,7 +14,6 @@ package org.dromara.hutool.core.text;
|
||||
|
||||
import org.dromara.hutool.core.collection.CollUtil;
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
package org.dromara.hutool.core.text;
|
||||
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.codec.HexUtil;
|
||||
|
||||
/**
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package org.dromara.hutool.core.text.dfa;
|
||||
|
||||
import org.dromara.hutool.core.lang.DefaultSegment;
|
||||
import org.dromara.hutool.core.lang.range.DefaultSegment;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -13,7 +13,7 @@
|
||||
package org.dromara.hutool.core.text.escape;
|
||||
|
||||
import org.dromara.hutool.core.text.replacer.StrReplacer;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
/**
|
||||
* 形如'的反转义器
|
||||
|
@ -13,7 +13,7 @@
|
||||
package org.dromara.hutool.core.text.finder;
|
||||
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
/**
|
||||
* 字符查找器<br>
|
||||
|
@ -15,7 +15,7 @@ package org.dromara.hutool.core.text.placeholder;
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.text.StrValidator;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
@ -18,7 +18,7 @@ import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.regex.PatternPool;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.text.finder.*;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -16,7 +16,7 @@ import org.dromara.hutool.core.collection.CollUtil;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
|
@ -16,7 +16,8 @@ import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.io.IORuntimeException;
|
||||
import org.dromara.hutool.core.io.IoUtil;
|
||||
import org.dromara.hutool.core.lang.id.Pid;
|
||||
import org.dromara.hutool.core.data.id.Pid;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -1,7 +1,20 @@
|
||||
package org.dromara.hutool.core.util;
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.array;
|
||||
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.collection.ListUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -16,16 +29,15 @@ import java.util.*;
|
||||
@SuppressWarnings("ConstantValue")
|
||||
public class ArrayUtilTest {
|
||||
|
||||
@SuppressWarnings("DataFlowIssue")
|
||||
@Test
|
||||
public void isEmptyTest() {
|
||||
final int[] a = {};
|
||||
Assertions.assertTrue(ArrayUtil.isEmpty(a));
|
||||
Assertions.assertTrue(ArrayUtil.isEmpty((Object) a));
|
||||
final int[] b = null;
|
||||
//noinspection ConstantConditions
|
||||
Assertions.assertTrue(ArrayUtil.isEmpty(b));
|
||||
final Object c = null;
|
||||
//noinspection ConstantConditions
|
||||
Assertions.assertTrue(ArrayUtil.isEmpty(c));
|
||||
|
||||
Object d = new Object[]{"1", "2", 3, 4D};
|
||||
@ -35,9 +47,7 @@ public class ArrayUtilTest {
|
||||
isEmpty = ArrayUtil.isEmpty(d);
|
||||
Assertions.assertTrue(isEmpty);
|
||||
d = null;
|
||||
//noinspection ConstantConditions
|
||||
isEmpty = ArrayUtil.isEmpty(d);
|
||||
//noinspection ConstantConditions
|
||||
Assertions.assertTrue(isEmpty);
|
||||
|
||||
// Object数组
|
||||
@ -520,7 +530,7 @@ public class ArrayUtilTest {
|
||||
@Test
|
||||
public void replaceTest2() {
|
||||
int[] a = new int[0];
|
||||
a = ArrayUtil.replace(a, 0, 1);
|
||||
a = ArrayUtil.replace(a, 0, new int[]{1});
|
||||
Assertions.assertEquals(1, a.length);
|
||||
}
|
||||
|
||||
@ -714,6 +724,7 @@ public class ArrayUtilTest {
|
||||
Assertions.assertTrue(b);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"RedundantArrayCreation", "ConfusingArgumentToVarargsMethod"})
|
||||
@Test
|
||||
public void startWithTest2() {
|
||||
boolean b = ArrayUtil.startWith(new int[]{}, new int[]{});
|
@ -7,7 +7,7 @@ public class ArrayWrapperTest {
|
||||
|
||||
@Test
|
||||
void getSubTest() {
|
||||
ArrayWrapper<int[]> array = ArrayWrapper.of(new int[]{1, 2, 3, 4, 5});
|
||||
ArrayWrapper<int[], Object> array = ArrayWrapper.of(new int[]{1, 2, 3, 4, 5});
|
||||
int[] sub = array.getSub(1, 4);
|
||||
Assertions.assertArrayEquals(new int[]{2, 3, 4}, sub);
|
||||
|
||||
@ -18,7 +18,7 @@ public class ArrayWrapperTest {
|
||||
|
||||
@Test
|
||||
void getSubStepTest() {
|
||||
ArrayWrapper<int[]> array = ArrayWrapper.of(new int[]{1, 2, 3, 4, 5});
|
||||
ArrayWrapper<int[], Object> array = ArrayWrapper.of(new int[]{1, 2, 3, 4, 5});
|
||||
int[] sub = array.getSub(1, 4, 2);
|
||||
Assertions.assertArrayEquals(new int[]{2, 4}, sub);
|
||||
|
||||
|
@ -1,4 +1,16 @@
|
||||
package org.dromara.hutool.core.util;
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.data;
|
||||
|
||||
import org.dromara.hutool.core.date.DateTime;
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
@ -1,6 +1,6 @@
|
||||
package org.dromara.hutool.core.lang;
|
||||
|
||||
import org.dromara.hutool.core.lang.id.NanoId;
|
||||
import org.dromara.hutool.core.data.id.NanoId;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package org.dromara.hutool.core.lang;
|
||||
|
||||
import org.dromara.hutool.core.lang.id.ObjectId;
|
||||
import org.dromara.hutool.core.data.id.ObjectId;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -2,8 +2,8 @@ package org.dromara.hutool.core.lang;
|
||||
|
||||
import org.dromara.hutool.core.collection.ConcurrentHashSet;
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.lang.id.IdUtil;
|
||||
import org.dromara.hutool.core.lang.id.Snowflake;
|
||||
import org.dromara.hutool.core.data.id.IdUtil;
|
||||
import org.dromara.hutool.core.data.id.Snowflake;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.dromara.hutool.core.lang;
|
||||
|
||||
import org.dromara.hutool.core.collection.ConcurrentHashSet;
|
||||
import org.dromara.hutool.core.lang.id.UUID;
|
||||
import org.dromara.hutool.core.data.id.UUID;
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -2,7 +2,7 @@ package org.dromara.hutool.core.lang;
|
||||
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import org.dromara.hutool.core.exception.ValidateException;
|
||||
import org.dromara.hutool.core.lang.id.IdUtil;
|
||||
import org.dromara.hutool.core.data.id.IdUtil;
|
||||
import org.dromara.hutool.core.regex.PatternPool;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
|
@ -1,4 +1,16 @@
|
||||
package org.dromara.hutool.core.util;
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.text;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
@ -1,7 +1,6 @@
|
||||
package org.dromara.hutool.core.text;
|
||||
|
||||
import org.dromara.hutool.core.map.Dict;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -2,7 +2,6 @@ package org.dromara.hutool.core.text;
|
||||
|
||||
import org.dromara.hutool.core.map.Dict;
|
||||
import org.dromara.hutool.core.text.split.SplitUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.util.RandomUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.reflect.ClassUtil;
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.exception.CloneException;
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
|
||||
|
@ -1,6 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.collection.ListUtil;
|
||||
import org.dromara.hutool.core.util.EnumUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.codec.hash.HashUtil;
|
||||
import org.dromara.hutool.core.util.ByteUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.codec.HexUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.collection.ConcurrentHashSet;
|
||||
@ -5,8 +17,8 @@ import org.dromara.hutool.core.date.DateUtil;
|
||||
import org.dromara.hutool.core.date.StopWatch;
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.lang.id.IdUtil;
|
||||
import org.dromara.hutool.core.lang.id.Snowflake;
|
||||
import org.dromara.hutool.core.data.id.IdUtil;
|
||||
import org.dromara.hutool.core.data.id.Snowflake;
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
|
@ -1,7 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.collection.iter.EnumerationIter;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.util.JNDIUtil;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.util.JdkUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.reflect.FieldUtil;
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
|
@ -1,8 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.collection.ListUtil;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,9 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.collection.ListUtil;
|
||||
import org.dromara.hutool.core.convert.Convert;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.math.NumberUtil;
|
||||
import org.dromara.hutool.core.util.RandomUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.collection.ListUtil;
|
||||
|
@ -1,7 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.lang.mutable.MutableObj;
|
||||
import org.dromara.hutool.core.util.ReferenceUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -1,6 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.util.RuntimeUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.reflect.FieldUtil;
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.bean.BeanUtil;
|
||||
@ -8,6 +20,7 @@ import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.map.MapBuilder;
|
||||
import org.dromara.hutool.core.map.MapUtil;
|
||||
import lombok.Data;
|
||||
import org.dromara.hutool.core.util.XmlUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -1,3 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.util;
|
||||
|
||||
import org.dromara.hutool.core.compress.ZipReader;
|
||||
@ -6,6 +18,8 @@ import org.dromara.hutool.core.io.IORuntimeException;
|
||||
import org.dromara.hutool.core.io.file.FileUtil;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.ByteUtil;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -15,8 +15,8 @@ package org.dromara.hutool.cron;
|
||||
import org.dromara.hutool.core.map.MapUtil;
|
||||
import org.dromara.hutool.core.thread.ExecutorBuilder;
|
||||
import org.dromara.hutool.core.thread.ThreadFactoryBuilder;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.lang.id.IdUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.data.id.IdUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.cron.listener.TaskListener;
|
||||
import org.dromara.hutool.cron.listener.TaskListenerManager;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.dromara.hutool.cron;
|
||||
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.lang.id.IdUtil;
|
||||
import org.dromara.hutool.core.data.id.IdUtil;
|
||||
import org.dromara.hutool.cron.pattern.CronPattern;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -3,7 +3,7 @@ package org.dromara.hutool.cron.demo;
|
||||
import org.dromara.hutool.core.date.DateUtil;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.thread.ThreadUtil;
|
||||
import org.dromara.hutool.core.lang.id.IdUtil;
|
||||
import org.dromara.hutool.core.data.id.IdUtil;
|
||||
|
||||
/**
|
||||
* 测试定时任务,当触发到定时的时间点时,执行doTest方法
|
||||
|
@ -17,7 +17,7 @@ import org.dromara.hutool.core.io.file.FileUtil;
|
||||
import org.dromara.hutool.core.io.IoUtil;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.util.CharUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.util.RandomUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.crypto.asymmetric.AsymmetricAlgorithm;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user