package com.zzg.common.enums;
|
|
import lombok.AllArgsConstructor;
|
import lombok.Getter;
|
|
@Getter
|
@AllArgsConstructor
|
public enum HouseProductionTypeEnum {
|
PRIVATE_USE(1, "私产"),
|
PUBLIC_USE(2, "公产");
|
private final Integer value;
|
|
private final String text;
|
|
public static String getValueByKey(Integer key) {
|
for (HouseProductionTypeEnum v : HouseProductionTypeEnum.values()) {
|
if (v.getValue().equals(key)) {
|
return v.getText();
|
}
|
}
|
return "";
|
}
|
|
public static String getText(Integer key) {
|
for (HouseProductionTypeEnum v : HouseProductionTypeEnum.values()) {
|
if (key.equals(v.getValue())) {
|
return v.getText();
|
}
|
}
|
return "";
|
}
|
public static Integer getValue(String text) {
|
for (HouseProductionTypeEnum v : HouseProductionTypeEnum.values()) {
|
if (v.getText().equals(text)) {
|
return v.getValue();
|
}
|
}
|
return 0;
|
}
|
|
}
|