Gender 实现 IWithIntCode 接口。

pull/2/head
ZhouXY108 2024-12-16 09:38:52 +08:00
parent 424857df6a
commit 1e4306005e
1 changed files with 7 additions and 1 deletions

View File

@ -16,6 +16,7 @@
package xyz.zhouxy.plusone.commons.model; package xyz.zhouxy.plusone.commons.model;
import xyz.zhouxy.plusone.commons.base.IWithIntCode;
import xyz.zhouxy.plusone.commons.util.AssertTools; import xyz.zhouxy.plusone.commons.util.AssertTools;
/** /**
@ -23,7 +24,7 @@ import xyz.zhouxy.plusone.commons.util.AssertTools;
* *
* @author <a href="http://zhouxy.xyz:3000/ZhouXY108">ZhouXY</a> * @author <a href="http://zhouxy.xyz:3000/ZhouXY108">ZhouXY</a>
*/ */
public enum Gender { public enum Gender implements IWithIntCode {
UNKNOWN(0, "Unknown", "未知"), UNKNOWN(0, "Unknown", "未知"),
MALE(1, "Male", "男"), MALE(1, "Male", "男"),
FEMALE(2, "Female", "女"), FEMALE(2, "Female", "女"),
@ -60,4 +61,9 @@ public enum Gender {
return displayNameZh; return displayNameZh;
} }
@Override
public int getCode() {
return getValue();
}
} }