package com.panzhihua.common.enums;
|
|
import lombok.Getter;
|
|
/**
|
* 房屋状态
|
*
|
* @author LYQ
|
*/
|
@Getter
|
public enum PopulHouseStatusEnum {
|
ZI_ZHU(1, "自住"), ZU_ZHU(2, "租住"), QI_TA(3, "其他");
|
|
private final Integer code;
|
private final String name;
|
|
PopulHouseStatusEnum(Integer code, String name) {
|
this.code = code;
|
this.name = name;
|
}
|
|
public static int getCodeByName(String name) {
|
for (PopulHouseStatusEnum item : PopulHouseStatusEnum.values()) {
|
if (item.name.equals(name)) {
|
return item.getCode();
|
}
|
}
|
return -1;
|
}
|
|
public static String getCnDescByName(Integer code) {
|
for (PopulHouseStatusEnum item : PopulHouseStatusEnum.values()) {
|
if (item.code.equals(code)) {
|
return item.getName();
|
}
|
}
|
return "其他";
|
}
|
|
}
|