调整枚举类。
This commit is contained in:
parent
39d8eac578
commit
363460fe96
@ -21,8 +21,7 @@ public final class EntityStatus extends Enumeration<EntityStatus> {
|
|||||||
public static final EntityStatus AVAILABLE = new EntityStatus(0, "正常");
|
public static final EntityStatus AVAILABLE = new EntityStatus(0, "正常");
|
||||||
public static final EntityStatus DISABLED = new EntityStatus(1, "禁用");
|
public static final EntityStatus DISABLED = new EntityStatus(1, "禁用");
|
||||||
|
|
||||||
private static final ValueSet<EntityStatus> VALUE_SET = new ValueSet<>(
|
private static final ValueSet<EntityStatus> VALUE_SET = ValueSet.of(AVAILABLE, DISABLED);
|
||||||
AVAILABLE, DISABLED);
|
|
||||||
|
|
||||||
public static EntityStatus of(int id) {
|
public static EntityStatus of(int id) {
|
||||||
return VALUE_SET.get(id);
|
return VALUE_SET.get(id);
|
||||||
|
@ -23,7 +23,7 @@ public final class AccountStatus extends Enumeration<AccountStatus> implements I
|
|||||||
public static final AccountStatus AVAILABLE = new AccountStatus(0, "账号正常");
|
public static final AccountStatus AVAILABLE = new AccountStatus(0, "账号正常");
|
||||||
public static final AccountStatus LOCKED = new AccountStatus(1, "账号被锁定");
|
public static final AccountStatus LOCKED = new AccountStatus(1, "账号被锁定");
|
||||||
|
|
||||||
private static final ValueSet<AccountStatus> VALUE_SET = new ValueSet<>(
|
private static final ValueSet<AccountStatus> VALUE_SET = ValueSet.of(
|
||||||
AVAILABLE,
|
AVAILABLE,
|
||||||
LOCKED);
|
LOCKED);
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ public final class Sex extends Enumeration<Sex> implements IValueObject {
|
|||||||
super(id, name);
|
super(id, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final ValueSet<Sex> VALUE_SET = new ValueSet<>(UNSET, MALE, FEMALE);
|
private static final ValueSet<Sex> VALUE_SET = ValueSet.of(UNSET, MALE, FEMALE);
|
||||||
|
|
||||||
@StaticFactoryMethod(Sex.class)
|
@StaticFactoryMethod(Sex.class)
|
||||||
public static Sex of(int value) {
|
public static Sex of(int value) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user