Skip to content

Commit 4e2c460

Browse files
committed
添加EnumUtil#getBy(Class, Func1, Object)方法
1 parent 603b7aa commit 4e2c460

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* 【core 】 优化MAC地址正则(issue#IB95X4@Gitee)
1111
* 【json 】 JSON的getByPath方法新增更为通用的指定出参类型重载(pr#3814@Github)
1212
* 【core 】 DateUtil.parseUTC方法标记废弃,改名为parseISO8601(issue#IBB6I5@Gitee)
13+
* 【core 】 添加EnumUtil#getBy(Class, Func1, Object)方法(pr#1283@Gitee)
1314

1415
### 🐞Bug修复
1516
* 【crypto 】 修复JWTSignerUtil.createSigner中algorithmId未转换问题(issue#3806@Github)

hutool-core/src/main/java/cn/hutool/core/util/EnumUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@ public static <E extends Enum<E>> E getBy(Class<E> enumClass, Predicate<? super
260260

261261
/**
262262
* 通过 某字段对应值 获取 枚举,获取不到时为 {@code null}
263-
* <p/>
263+
* <p>
264264
* {@link LambdaUtil#getRealClass(Func1)}} 是相对耗时的
265265
* 如果枚举值比较多,那么{@link EnumUtil#getBy(Func1, Object)} 方法
266266
* 大部分时间都是被{@link LambdaUtil#getRealClass(Func1)}}所消耗的
267-
* <br/>
267+
* <br>
268268
* 如果可以在编码过程中可以提供对应的枚举类 该方法与枚举的{@code Enum.values()}方法是差不多的。
269269
*
270270
* @param enumClass 枚举类, 为{@code null}返回{@code null}

0 commit comments

Comments
 (0)