feat(core): Add utility method to convert boolean to YesNoEnum code

This commit is contained in:
冷冷 committed 2025-02-17 15:35:50 +08:00
1 parent 84a5f75776
commit 3e7df4cc61
1 file changed
+11
@@ -25,4 +25,15 @@ public enum YesNoEnum {
*/
private String desc;
/**
* 通过布尔值获取代码
*
* @param bool 布尔
* @return {@link String }
*/
public static String getCode(Boolean bool) {
return bool ? YES.getCode() : NO.getCode();
}
}