mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-11 13:19:01 +08:00
feat(core): Add utility method to convert boolean to YesNoEnum code
This commit is contained in:
1 parent
a6b1994861
commit
eb161c980c
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