mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 20:49:00 +08:00
feat(core): Add utility method to convert boolean to YesNoEnum code
This commit is contained in:
1 parent
84a5f75776
commit
3e7df4cc61
1 file changed
+11
+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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user