remove deprecated methods

This commit is contained in:
Looly
2021-06-16 00:51:20 +08:00
parent 8b85134c4b
commit f9b6110042
59 changed files with 214 additions and 2185 deletions

View File

@@ -291,32 +291,6 @@ public class Base64 {
return Base64Decoder.decode(base64);
}
/**
* base64解码
*
* @param source 被解码的base64字符串
* @param charset 字符集
* @return 被加密后的字符串
* @deprecated 编码参数无意义,作废
*/
@Deprecated
public static byte[] decode(CharSequence source, String charset) {
return Base64Decoder.decode(source);
}
/**
* base64解码
*
* @param source 被解码的base64字符串
* @param charset 字符集
* @return 被加密后的字符串
* @deprecated 编码参数无意义,作废
*/
@Deprecated
public static byte[] decode(CharSequence source, Charset charset) {
return Base64Decoder.decode(source);
}
/**
* 解码Base64
*

View File

@@ -636,48 +636,6 @@ public class CollUtil {
return currentAlaDatas;
}
// ----------------------------------------------------------------------------------------------- new HashMap
/**
* 新建一个HashMap
*
* @param <K> Key类型
* @param <V> Value类型
* @return HashMap对象
* @see MapUtil#newHashMap()
*/
public static <K, V> HashMap<K, V> newHashMap() {
return MapUtil.newHashMap();
}
/**
* 新建一个HashMap
*
* @param <K> Key类型
* @param <V> Value类型
* @param size 初始大小由于默认负载因子0.75传入的size会实际初始大小为size / 0.75
* @param isOrder Map的Key是否有序有序返回 {@link LinkedHashMap},否则返回 {@link HashMap}
* @return HashMap对象
* @see MapUtil#newHashMap(int, boolean)
* @since 3.0.4
*/
public static <K, V> HashMap<K, V> newHashMap(int size, boolean isOrder) {
return MapUtil.newHashMap(size, isOrder);
}
/**
* 新建一个HashMap
*
* @param <K> Key类型
* @param <V> Value类型
* @param size 初始大小由于默认负载因子0.75传入的size会实际初始大小为size / 0.75
* @return HashMap对象
* @see MapUtil#newHashMap(int)
*/
public static <K, V> HashMap<K, V> newHashMap(int size) {
return MapUtil.newHashMap(size);
}
// ----------------------------------------------------------------------------------------------- new HashSet
/**
@@ -1043,20 +1001,6 @@ public class CollUtil {
return list;
}
/**
* 创建Map<br>
* 传入AbstractMap和{@link Map}类将默认创建{@link HashMap}
*
* @param <K> map键类型
* @param <V> map值类型
* @param mapType map类型
* @return {@link Map}实例
* @see MapUtil#createMap(Class)
*/
public static <K, V> Map<K, V> createMap(Class<?> mapType) {
return MapUtil.createMap(mapType);
}
/**
* 去重集合
*
@@ -1178,8 +1122,8 @@ public class CollUtil {
}
/**
* 过滤,此方法产生一个新集合<br>
* 过滤过程通过传入的Editor实现来返回需要的元素内容这个Editor实现可以实现以下功能
* 编辑,此方法产生一个新集合<br>
* 编辑过程通过传入的Editor实现来返回需要的元素内容这个Editor实现可以实现以下功能
*
* <pre>
* 1、过滤出需要的对象如果返回null表示这个元素对象抛弃
@@ -1191,7 +1135,7 @@ public class CollUtil {
* @param editor 编辑器接口
* @return 过滤后的集合
*/
public static <T> Collection<T> filter(Collection<T> collection, Editor<T> editor) {
public static <T> Collection<T> edit(Collection<T> collection, Editor<T> editor) {
if (null == collection || null == editor) {
return collection;
}
@@ -1214,25 +1158,6 @@ public class CollUtil {
return collection2;
}
/**
* 过滤<br>
* 过滤过程通过传入的Editor实现来返回需要的元素内容这个Editor实现可以实现以下功能
*
* <pre>
* 1、过滤出需要的对象如果返回null表示这个元素对象抛弃
* 2、修改元素对象返回集合中为修改后的对象
* </pre>
*
* @param <T> 集合元素类型
* @param list 集合
* @param editor 编辑器接口
* @return 过滤后的数组
* @since 4.1.8
*/
public static <T> List<T> filter(List<T> list, Editor<T> editor) {
return ListUtil.filter(list, editor);
}
/**
* 过滤<br>
* 过滤过程通过传入的Filter实现来过滤返回需要的元素内容这个Filter实现可以实现以下功能
@@ -1248,24 +1173,7 @@ public class CollUtil {
* @since 3.1.0
*/
public static <T> Collection<T> filterNew(Collection<T> collection, Filter<T> filter) {
if (null == collection || null == filter) {
return collection;
}
Collection<T> collection2 = ObjectUtil.clone(collection);
try {
collection2.clear();
} catch (UnsupportedOperationException e) {
// 克隆后的对象不支持清空说明为不可变集合对象使用默认的ArrayList保存结果
collection2 = new ArrayList<>();
}
for (T t : collection) {
if (filter.accept(t)) {
collection2.add(t);
}
}
return collection2;
return edit(collection, t -> filter.accept(t) ? t : null);
}
/**
@@ -1283,7 +1191,7 @@ public class CollUtil {
* @since 4.1.8
*/
public static <T> List<T> filterNew(List<T> list, Filter<T> filter) {
return ListUtil.filter(list, t -> filter.accept(t) ? t : null);
return ListUtil.editNew(list, t -> filter.accept(t) ? t : null);
}
/**
@@ -1540,47 +1448,6 @@ public class CollUtil {
});
}
/**
* 过滤<br>
* 过滤过程通过传入的Editor实现来返回需要的元素内容这个Editor实现可以实现以下功能
*
* <pre>
* 1、过滤出需要的对象如果返回null表示这个元素对象抛弃
* 2、修改元素对象返回集合中为修改后的对象
* </pre>
*
* @param <K> Key类型
* @param <V> Value类型
* @param map Map
* @param editor 编辑器接口
* @return 过滤后的Map
* @see MapUtil#edit(Map, Editor)
*/
public static <K, V> Map<K, V> edit(Map<K, V> map, Editor<Entry<K, V>> editor) {
return MapUtil.edit(map, editor);
}
/**
* 过滤<br>
* 过滤过程通过传入的Editor实现来返回需要的元素内容这个Editor实现可以实现以下功能
*
* <pre>
* 1、过滤出需要的对象如果返回null表示这个元素对象抛弃
* 2、修改元素对象返回集合中为修改后的对象
* </pre>
*
* @param <K> Key类型
* @param <V> Value类型
* @param map Map
* @param filter 编辑器接口
* @return 过滤后的Map
* @see MapUtil#filter(Map, Filter)
* @since 3.1.0
*/
public static <K, V> Map<K, V> filter(Map<K, V> map, Filter<Entry<K, V>> filter) {
return MapUtil.filter(map, filter);
}
/**
* 集合中匹配规则的数量
*
@@ -1702,17 +1569,6 @@ public class CollUtil {
return isEmpty(collection) ? defaultCollection : collection;
}
/**
* Map是否为空
*
* @param map 集合
* @return 是否为空
* @see MapUtil#isEmpty(Map)
*/
public static boolean isEmpty(Map<?, ?> map) {
return MapUtil.isEmpty(map);
}
/**
* Iterable是否为空
*
@@ -1757,17 +1613,6 @@ public class CollUtil {
return false == isEmpty(collection);
}
/**
* Map是否为非空
*
* @param map 集合
* @return 是否为非空
* @see MapUtil#isNotEmpty(Map)
*/
public static boolean isNotEmpty(Map<?, ?> map) {
return MapUtil.isNotEmpty(map);
}
/**
* Iterable是否为空
*
@@ -1870,7 +1715,7 @@ public class CollUtil {
}
int entryCount = Math.min(keys.size(), values.size());
final Map<K, V> map = newHashMap(entryCount);
final Map<K, V> map = MapUtil.newHashMap(entryCount);
final Iterator<K> keyIterator = keys.iterator();
final Iterator<V> valueIterator = values.iterator();

View File

@@ -1,6 +1,7 @@
package cn.hutool.core.collection;
import cn.hutool.core.exceptions.UtilException;
import cn.hutool.core.lang.Editor;
import cn.hutool.core.lang.Filter;
import cn.hutool.core.lang.func.Func1;
import cn.hutool.core.map.MapUtil;
@@ -129,24 +130,6 @@ public class IterUtil {
return true;
}
/**
* 根据集合返回一个元素计数的 {@link Map}<br>
* 所谓元素计数就是假如这个集合中某个元素出现了n次那将这个元素做为keyn做为value<br>
* 例如:[a,b,c,c,c] 得到:<br>
* a: 1<br>
* b: 1<br>
* c: 3<br>
*
* @param <T> 集合元素类型
* @param iter {@link Iterable}如果为null返回一个空的Map
* @return {@link Map}
* @deprecated 如果对象同时实现Iterable和Iterator接口会产生歧义请使用CollUtil.countMap
*/
@Deprecated
public static <T> Map<T, Integer> countMap(Iterable<T> iter) {
return countMap(null == iter ? null : iter.iterator());
}
/**
* 根据集合返回一个元素计数的 {@link Map}<br>
* 所谓元素计数就是假如这个集合中某个元素出现了n次那将这个元素做为keyn做为value<br>
@@ -171,23 +154,6 @@ public class IterUtil {
return countMap;
}
/**
* 字段值与列表值对应的Map常用于元素对象中有唯一ID时需要按照这个ID查找对象的情况<br>
* 例如:车牌号 =》车
*
* @param <K> 字段名对应值得类型不确定请使用Object
* @param <V> 对象类型
* @param iter 对象列表
* @param fieldName 字段名(会通过反射获取其值)
* @return 某个字段值与对象对应Map
* @since 4.0.4
* @deprecated 如果对象同时实现Iterable和Iterator接口会产生歧义请使用CollUtil.fieldValueMap
*/
@Deprecated
public static <K, V> Map<K, V> fieldValueMap(Iterable<V> iter, String fieldName) {
return fieldValueMap(null == iter ? null : iter.iterator(), fieldName);
}
/**
* 字段值与列表值对应的Map常用于元素对象中有唯一ID时需要按照这个ID查找对象的情况<br>
* 例如:车牌号 =》车
@@ -204,23 +170,6 @@ public class IterUtil {
return toMap(iter, new HashMap<>(), (value) -> (K) ReflectUtil.getFieldValue(value, fieldName));
}
/**
* 两个字段值组成新的Map
*
* @param <K> 字段名对应值得类型不确定请使用Object
* @param <V> 值类型不确定使用Object
* @param iterable 对象列表
* @param fieldNameForKey 做为键的字段名(会通过反射获取其值)
* @param fieldNameForValue 做为值的字段名(会通过反射获取其值)
* @return 某个字段值与对象对应Map
* @since 4.6.2
* @deprecated 如果对象同时实现Iterable和Iterator接口会产生歧义请使用CollUtil.fieldValueMap
*/
@Deprecated
public static <K, V> Map<K, V> fieldValueAsMap(Iterable<?> iterable, String fieldNameForKey, String fieldNameForValue) {
return fieldValueAsMap(null == iterable ? null : iterable.iterator(), fieldNameForKey, fieldNameForValue);
}
/**
* 两个字段值组成新的Map
*
@@ -274,43 +223,6 @@ public class IterUtil {
return result;
}
/**
* 以 conjunction 为分隔符将集合转换为字符串
*
* @param <T> 集合元素类型
* @param iterable {@link Iterable}
* @param conjunction 分隔符
* @return 连接后的字符串
* @deprecated 如果对象同时实现Iterable和Iterator接口会产生歧义请使用CollUtil.join
*/
@Deprecated
public static <T> String join(Iterable<T> iterable, CharSequence conjunction) {
if (null == iterable) {
return null;
}
return join(iterable.iterator(), conjunction);
}
/**
* 以 conjunction 为分隔符将集合转换为字符串
*
* @param <T> 集合元素类型
* @param iterable {@link Iterable}
* @param conjunction 分隔符
* @param prefix 每个元素添加的前缀null表示不添加
* @param suffix 每个元素添加的后缀null表示不添加
* @return 连接后的字符串
* @since 4.0.10
* @deprecated 如果对象同时实现Iterable和Iterator接口会产生歧义请使用CollUtil.join
*/
@Deprecated
public static <T> String join(Iterable<T> iterable, CharSequence conjunction, String prefix, String suffix) {
if (null == iterable) {
return null;
}
return join(iterable.iterator(), conjunction, prefix, suffix);
}
/**
* 以 conjunction 为分隔符将集合转换为字符串<br>
* 如果集合元素为数组、{@link Iterable}或{@link Iterator},则递归组合其为字符串
@@ -337,11 +249,11 @@ public class IterUtil {
* @since 4.0.10
*/
public static <T> String join(Iterator<T> iterator, CharSequence conjunction, String prefix, String suffix) {
return join(iterator, conjunction, (item)->{
return join(iterator, conjunction, (item) -> {
if (ArrayUtil.isArray(item)) {
return ArrayUtil.join(ArrayUtil.wrap(item), conjunction, prefix, suffix);
} else if (item instanceof Iterable<?>) {
return join((Iterable<?>) item, conjunction, prefix, suffix);
return CollUtil.join((Iterable<?>) item, conjunction, prefix, suffix);
} else if (item instanceof Iterator<?>) {
return join((Iterator<?>) item, conjunction, prefix, suffix);
} else {
@@ -706,6 +618,37 @@ public class IterUtil {
return null;
}
/**
* 编辑,此方法产生一个新{@link ArrayList}<br>
* 编辑过程通过传入的Editor实现来返回需要的元素内容这个Editor实现可以实现以下功能
*
* <pre>
* 1、过滤出需要的对象如果返回null表示这个元素对象抛弃
* 2、修改元素对象返回集合中为修改后的对象
* </pre>
*
* @param <T> 集合元素类型
* @param iter 集合
* @param editor 编辑器接口, {@code null}表示不编辑
* @return 过滤后的集合
* @since 5.7.1
*/
public static <T> List<T> edit(Iterable<T> iter, Editor<T> editor) {
final List<T> result = new ArrayList<>();
if (null == iter) {
return result;
}
T modified;
for (T t : iter) {
modified = (null == editor) ? t : editor.edit(t);
if (null != modified) {
result.add(t);
}
}
return result;
}
/**
* 过滤集合,此方法在原集合上直接修改<br>
* 通过实现Filter接口完成元素的过滤这个Filter实现可以实现以下功能

View File

@@ -424,13 +424,14 @@ public class ListUtil {
}
/**
* 过滤<br>
* 编辑列表<br>
* 过滤过程通过传入的Editor实现来返回需要的元素内容这个Editor实现可以实现以下功能
*
* <pre>
* 1、过滤出需要的对象如果返回null表示这个元素对象抛弃
* 2、修改元素对象返回集合中为修改后的对象
* </pre>
* 注意此方法会修改原List
*
* @param <T> 集合元素类型
* @param list 集合
@@ -438,20 +439,41 @@ public class ListUtil {
* @return 过滤后的数组
* @since 4.1.8
*/
public static <T> List<T> filter(List<T> list, Editor<T> editor) {
public static <T> List<T> editNew(List<T> list, Editor<T> editor) {
return (List<T>) CollUtil.edit(list, editor);
}
/**
* 编辑列表<br>
* 过滤过程通过传入的Editor实现来返回需要的元素内容这个Editor实现可以实现以下功能
*
* <pre>
* 1、过滤出需要的对象如果返回null表示这个元素对象抛弃
* 2、修改元素对象返回集合中为修改后的对象
* </pre>
* 注意此方法会修改原List
*
* @param <T> 集合元素类型
* @param list 集合
* @param editor 编辑器接口
* @return 过滤后的数组
* @since 4.1.8
*/
public static <T> List<T> edit(List<T> list, Editor<T> editor) {
if (null == list || null == editor) {
return list;
}
final List<T> list2 = (list instanceof LinkedList) ? new LinkedList<>() : new ArrayList<>(list.size());
T modified;
for (T t : list) {
modified = editor.edit(t);
if (null != modified) {
list2.add(modified);
final int size = list.size();
T ele;
for (int i = 0; i < size; i++) {
ele = list.get(i);
ele = editor.edit(ele);
if(null != ele){
list.set(i, ele);
}
}
return list2;
return list;
}
/**

View File

@@ -846,20 +846,6 @@ public class Convert {
return HexUtil.decodeHex(src.toCharArray());
}
/**
* 十六进制转换字符串
*
* @param hexStr Byte字符串(Byte之间无分隔符 如:[616C6B])
* @param charset 编码 {@link Charset}
* @return 对应的字符串
* @see HexUtil#decodeHexStr(String, Charset)
* @deprecated 请使用 {@link #hexToStr(String, Charset)}
*/
@Deprecated
public static String hexStrToStr(String hexStr, Charset charset) {
return hexToStr(hexStr, charset);
}
/**
* 十六进制转换字符串
*

View File

@@ -1,43 +0,0 @@
package cn.hutool.core.convert.impl;
import cn.hutool.core.convert.AbstractConverter;
/**
* 泛型枚举转换器
*
* @param <E> 枚举类类型
* @author Looly
* @since 4.0.2
* @deprecated 请使用{@link EnumConverter}
*/
@Deprecated
public class GenericEnumConverter<E extends Enum<E>> extends AbstractConverter<E> {
private static final long serialVersionUID = 1L;
private final Class<E> enumClass;
/**
* 构造
*
* @param enumClass 转换成的目标Enum类
*/
public GenericEnumConverter(Class<E> enumClass) {
this.enumClass = enumClass;
}
@SuppressWarnings("unchecked")
@Override
protected E convertInternal(Object value) {
E enumValue = (E) EnumConverter.tryConvertEnum(value, this.enumClass);
if(null == enumValue && false == value instanceof String){
// 最后尝试valueOf转换
enumValue = Enum.valueOf(this.enumClass, convertToStr(value));
}
return enumValue;
}
@Override
public Class<E> getTargetType() {
return this.enumClass;
}
}

View File

@@ -1,21 +0,0 @@
package cn.hutool.core.date;
/**
* 时长格式化器<br>
*
*
* @author Looly
* @deprecated 拼写错误,请使用{@link BetweenFormatter}
*/
@Deprecated
public class BetweenFormater extends BetweenFormatter {
private static final long serialVersionUID = 1L;
public BetweenFormater(long betweenMs, Level level) {
super(betweenMs, level);
}
public BetweenFormater(long betweenMs, Level level, int levelMaxCount) {
super(betweenMs, level, levelMaxCount);
}
}

View File

@@ -161,13 +161,6 @@ public class BetweenFormatter implements Serializable {
* 秒
*/
SECOND(""),
/**
* 毫秒
*
* @deprecated 拼写错误,请使用{@link #MILLISECOND}
*/
@Deprecated
MILLSECOND("毫秒"),
/**
* 毫秒
*/

View File

@@ -571,17 +571,6 @@ public class DateTime extends Date {
return getField(DateField.MILLISECOND);
}
/**
* 获得指定日期的毫秒数部分<br>
*
* @return 毫秒数
* @deprecated 拼写错误,请使用{@link #millisecond()}
*/
@Deprecated
public int millsecond() {
return getField(DateField.MILLISECOND);
}
/**
* 是否为上午
*

View File

@@ -312,18 +312,6 @@ public class DateUtil extends CalendarUtil {
return DateTime.of(date).second();
}
/**
* 获得指定日期的毫秒数部分<br>
*
* @param date 日期
* @return 毫秒数
* @deprecated 拼写错误,请使用{@link #millisecond(Date)}
*/
@Deprecated
public static int millsecond(Date date) {
return DateTime.of(date).millisecond();
}
/**
* 获得指定日期的毫秒数部分<br>
*
@@ -432,15 +420,6 @@ public class DateUtil extends CalendarUtil {
return second(date());
}
/**
* @return 当前日期的毫秒数部分<br>
* @deprecated 拼写错误,请使用{@link #thisMillisecond()}
*/
@Deprecated
public static int thisMillsecond() {
return millisecond(date());
}
/**
* @return 当前日期的毫秒数部分<br>
*/
@@ -1326,19 +1305,6 @@ public class DateUtil extends CalendarUtil {
return dateNew(date).offset(dateField, offset);
}
/**
* 获取指定日期偏移指定时间后的时间
*
* @param date 基准日期
* @param dateField 偏移的粒度大小(小时、天、月等){@link DateField}
* @param offset 偏移量,正数为向后偏移,负数为向前偏移
* @return 偏移后的日期
* @deprecated please use {@link DateUtil#offset(Date, DateField, int)}
*/
@Deprecated
public static DateTime offsetDate(Date date, DateField dateField, int offset) {
return offset(date, dateField, offset);
}
// ------------------------------------ Offset end ----------------------------------------------
/**
@@ -1585,19 +1551,6 @@ public class DateUtil extends CalendarUtil {
return Integer.parseInt(DateUtil.format(date, "yyMMddHHmm"));
}
/**
* 计算指定指定时间区间内的周数
*
* @param start 开始时间
* @param end 结束时间
* @return 周数
* @deprecated 请使用 {@link #betweenWeek(Date, Date, boolean)}
*/
@Deprecated
public static int weekCount(Date start, Date end) {
return (int) betweenWeek(start, end, true);
}
/**
* 计时器<br>
* 计算某个过程花费的时间,精确到毫秒

View File

@@ -50,17 +50,6 @@ public class LunarInfo {
// 支持的最大年限
public static final int MAX_YEAR = BASE_YEAR + LUNAR_CODE.length - 1;
/**
* 获取支持的最大年(包括)
*
* @return 最大年(包括)
* @deprecated 使用 {@link #MAX_YEAR}
*/
@Deprecated
public static int getMaxYear() {
return MAX_YEAR;
}
/**
* 传回农历 y年的总天数
*

View File

@@ -356,32 +356,6 @@ public class Validator {
return value;
}
/**
* 通过正则表达式验证
*
* @param pattern 正则模式
* @param value 值
* @return 是否匹配正则
* @deprecated 请使用 {@link #isMatchRegex(Pattern, CharSequence)}
*/
@Deprecated
public static boolean isMactchRegex(Pattern pattern, CharSequence value) {
return ReUtil.isMatch(pattern, value);
}
/**
* 通过正则表达式验证
*
* @param regex 正则
* @param value 值
* @return 是否匹配正则
* @deprecated 拼写错误,请使用{@link #isMatchRegex(String, CharSequence)}
*/
@Deprecated
public static boolean isMactchRegex(String regex, CharSequence value) {
return ReUtil.isMatch(regex, value);
}
/**
* 通过正则表达式验证
*

View File

@@ -660,22 +660,7 @@ public class MapUtil {
* @since 3.1.0
*/
public static <K, V> Map<K, V> filter(Map<K, V> map, Filter<Entry<K, V>> filter) {
if (null == map || null == filter) {
return map;
}
final Map<K, V> map2 = ObjectUtil.clone(map);
if (isEmpty(map2)) {
return map2;
}
map2.clear();
for (Entry<K, V> entry : map.entrySet()) {
if (filter.accept(entry)) {
map2.put(entry.getKey(), entry.getValue());
}
}
return map2;
return edit(map, t -> filter.accept(t) ? t : null);
}
/**

View File

@@ -700,19 +700,6 @@ public class NetUtil {
return ip;
}
/**
* 检测给定字符串是否为未知多用于检测HTTP请求相关<br>
*
* @param checkString 被检测的字符串
* @return 是否未知
* @since 4.4.1
* @deprecated 拼写错误,请使用{@link #isUnknown(String)}
*/
@Deprecated
public static boolean isUnknow(String checkString) {
return isUnknown(checkString);
}
/**
* 检测给定字符串是否为未知多用于检测HTTP请求相关<br>
*

View File

@@ -1858,19 +1858,6 @@ public class CharSequenceUtil {
return StrSplitter.split(str.toString(), separatorStr, limit, isTrim, ignoreEmpty);
}
/**
* 切分字符串,如果分隔符不存在则返回原字符串
*
* @param str 被切分的字符串
* @param separator 分隔符
* @return 字符串
* @deprecated 请使用 {@link #splitToArray(CharSequence, char)}
*/
@Deprecated
public static String[] split(CharSequence str, CharSequence separator) {
return splitToArray(str, separator);
}
/**
* 根据给定长度,将给定字符串截取为多个部分
*

View File

@@ -1,11 +0,0 @@
package cn.hutool.core.text;
/**
* 字符串切分器
*
* @author looly
* @deprecated 此类拼写错误,请使用 {@link StrSplitter}
*/
@Deprecated
public class StrSpliter extends StrSplitter{
}

View File

@@ -1,6 +1,5 @@
package cn.hutool.core.thread;
import cn.hutool.core.exceptions.NotInitedException;
import cn.hutool.core.exceptions.UtilException;
import java.util.LinkedHashSet;
@@ -158,21 +157,6 @@ public class SyncFinisher {
clearWorker();
}
/**
* 等待所有Worker工作结束否则阻塞
*
* @throws InterruptedException 用户中断
* @deprecated 使用start方法指定是否阻塞等待
*/
@Deprecated
public void await() throws InterruptedException {
if (endLatch == null) {
throw new NotInitedException("Please call start() method first!");
}
endLatch.await();
}
/**
* 清空工作线程对象
*/

View File

@@ -2200,38 +2200,6 @@ public class NumberUtil {
return StrUtil.isBlank(number) ? BigInteger.ZERO : new BigInteger(number);
}
/**
* 是否空白符<br>
* 空白符包括空格、制表符、全角空格和不间断空格<br>
*
* @param c 字符
* @return 是否空白符
* @see Character#isWhitespace(int)
* @see Character#isSpaceChar(int)
* @since 3.0.6
* @deprecated 请使用{@link CharUtil#isBlankChar(char)}
*/
@Deprecated
public static boolean isBlankChar(char c) {
return isBlankChar((int) c);
}
/**
* 是否空白符<br>
* 空白符包括空格、制表符、全角空格和不间断空格<br>
*
* @param c 字符
* @return 是否空白符
* @see Character#isWhitespace(int)
* @see Character#isSpaceChar(int)
* @since 3.0.6
* @deprecated 请使用{@link CharUtil#isBlankChar(int)}
*/
@Deprecated
public static boolean isBlankChar(int c) {
return Character.isWhitespace(c) || Character.isSpaceChar(c) || c == '\ufeff' || c == '\u202a';
}
/**
* 计算等份个数
*

View File

@@ -453,21 +453,6 @@ public class ObjectUtil {
return SerializeUtil.deserialize(bytes);
}
/**
* 反序列化<br>
* 对象必须实现Serializable接口
*
* @param <T> 对象类型
* @param bytes 反序列化的字节码
* @return 反序列化后的对象
* @see #deserialize(byte[])
* @deprecated 请使用 {@link #deserialize(byte[])}
*/
@Deprecated
public static <T> T unserialize(byte[] bytes) {
return deserialize(bytes);
}
/**
* 是否为基本类型,包括包装类型和非包装类型
*

View File

@@ -5,7 +5,6 @@ import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.exceptions.UtilException;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.lang.WeightRandom;
import cn.hutool.core.lang.WeightRandom.WeightObj;
@@ -605,29 +604,6 @@ public class RandomUtil {
return new WeightRandom<>(weightObjs);
}
// ------------------------------------------------------------------- UUID
/**
* @return 随机UUID
* @deprecated 请使用{@link IdUtil#randomUUID()}
*/
@Deprecated
public static String randomUUID() {
return UUID.randomUUID().toString();
}
/**
* 简化的UUID去掉了横线
*
* @return 简化的UUID去掉了横线
* @since 3.2.2
* @deprecated 请使用{@link IdUtil#simpleUUID()}
*/
@Deprecated
public static String simpleUUID() {
return UUID.randomUUID().toString(true);
}
/**
* 以当天为基准,随机产生一个日期
*

View File

@@ -295,19 +295,6 @@ public class TypeUtil {
return null == type || type instanceof TypeVariable;
}
/**
* 指定泛型数组中是否含有泛型变量
*
* @param types 泛型数组
* @return 是否含有泛型变量
* @since 4.5.7
* @deprecated 拼写错误,请使用{@link #hasTypeVariable(Type...)}
*/
@Deprecated
public static boolean hasTypeVeriable(Type... types) {
return hasTypeVariable(types);
}
/**
* 指定泛型数组中是否含有泛型变量
*

View File

@@ -273,20 +273,6 @@ public class URLUtil {
}
}
/**
* 补全相对路径
*
* @param baseUrl 基准URL
* @param relativePath 相对URL
* @return 相对路径
* @throws UtilException MalformedURLException
* @deprecated 拼写错误,请使用{@link #completeUrl(String, String)}
*/
@Deprecated
public static String complateUrl(String baseUrl, String relativePath) {
return completeUrl(baseUrl, relativePath);
}
/**
* 补全相对路径
*
@@ -373,25 +359,6 @@ public class URLUtil {
return URLEncoder.DEFAULT.encode(url, charset);
}
/**
* 编码URL字符为 application/x-www-form-urlencoded<br>
* 将需要转换的内容ASCII码形式之外的内容用十六进制表示法转换出来并在之前加上%开头。<br>
* 此方法用于URL自动编码类似于浏览器中键入地址自动编码对于像类似于“/”的字符不再编码
*
* @param url URL
* @param charset 编码
* @return 编码后的URL
* @throws UtilException UnsupportedEncodingException
* @deprecated 请使用 {@link #encode(String, Charset)}
*/
@Deprecated
public static String encode(String url, String charset) throws UtilException {
if (StrUtil.isEmpty(url)) {
return url;
}
return encode(url, StrUtil.isBlank(charset) ? CharsetUtil.defaultCharset() : CharsetUtil.charset(charset));
}
/**
* 编码URL默认使用UTF-8编码<br>
* 将需要转换的内容ASCII码形式之外的内容用十六进制表示法转换出来并在之前加上%开头。<br>
@@ -426,22 +393,6 @@ public class URLUtil {
return URLEncoder.QUERY.encode(url, charset);
}
/**
* 编码URL<br>
* 将需要转换的内容ASCII码形式之外的内容用十六进制表示法转换出来并在之前加上%开头。<br>
* 此方法用于POST请求中的请求体自动编码转义大部分特殊字符
*
* @param url URL
* @param charset 编码
* @return 编码后的URL
* @throws UtilException UnsupportedEncodingException
* @deprecated 请使用 {@link #encodeQuery(String, Charset)}
*/
@Deprecated
public static String encodeQuery(String url, String charset) throws UtilException {
return encodeQuery(url, StrUtil.isBlank(charset) ? CharsetUtil.defaultCharset() : CharsetUtil.charset(charset));
}
/**
* 编码URL默认使用UTF-8编码<br>
* 将需要转换的内容ASCII码形式之外的内容用十六进制表示法转换出来并在之前加上%开头。<br>

View File

@@ -2,7 +2,6 @@ package cn.hutool.core.collection;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.lang.Editor;
import cn.hutool.core.lang.Filter;
import cn.hutool.core.map.MapUtil;
import lombok.AllArgsConstructor;
@@ -247,7 +246,7 @@ public class CollUtilTest {
public void filterTest() {
ArrayList<String> list = CollUtil.newArrayList("a", "b", "c");
Collection<String> filtered = CollUtil.filter(list, (Editor<String>) t -> t + 1);
Collection<String> filtered = CollUtil.edit(list, t -> t + 1);
Assert.assertEquals(CollUtil.newArrayList("a1", "b1", "c1"), filtered);
}