public enum SeasonEnum {
spring(1,"春天"),
summer(2,"夏天"),
aut(3,"秋天"),
win(4,"冬天"),
;
private int type;
private String tag;
AccountEnum(int type, String tag) {
this.type = type;
this.tag = tag;
}
public int getType() {
return type;
}
public String getTag() {
return tag;
}
/**
* 根据type匹配
* @param type
* @return
*/
public static SeasonEnum buildByType(Integer type) {
if (type == null) {
return null;
}
for (SeasonEnum accountEnum : SeasonEnum .values()) {
if (accountEnum.getType() == type) {
return accountEnum;
}
}
return null;
}
}
spring(1,"春天"),
summer(2,"夏天"),
aut(3,"秋天"),
win(4,"冬天"),
;
private int type;
private String tag;
AccountEnum(int type, String tag) {
this.type = type;
this.tag = tag;
}
public int getType() {
return type;
}
public String getTag() {
return tag;
}
/**
* 根据type匹配
* @param type
* @return
*/
public static SeasonEnum buildByType(Integer type) {
if (type == null) {
return null;
}
for (SeasonEnum accountEnum : SeasonEnum .values()) {
if (accountEnum.getType() == type) {
return accountEnum;
}
}
return null;
}
}