package com.panzhihua.common.enums;
|
|
import lombok.Getter;
|
|
/**
|
* 本地外地
|
*
|
* @author LYQ
|
*/
|
@Getter
|
public enum PopulOutOrLocalEnum {
|
BD(1, "本地"), WD(2, "外地");
|
|
private final Integer code;
|
private final String name;
|
|
PopulOutOrLocalEnum(Integer code, String name) {
|
this.code = code;
|
this.name = name;
|
}
|
|
public static int getCodeByName(String name) {
|
for (PopulOutOrLocalEnum item : PopulOutOrLocalEnum.values()) {
|
if (item.name.equals(name)) {
|
return item.getCode();
|
}
|
}
|
return -1;
|
}
|
|
public static String getCnDescByName(Integer code) {
|
for (PopulOutOrLocalEnum item : PopulOutOrLocalEnum.values()) {
|
if (item.code.equals(code)) {
|
return item.getName();
|
}
|
}
|
return "";
|
}
|
|
}
|