枚举值维护
This commit is contained in:
@@ -6,9 +6,9 @@ import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public enum PassengerFlowEnum {
|
||||
BELOW_1000(0,"1000以下"),
|
||||
TO_1000_10000(1,"1000-1万"),
|
||||
MORE_THAN_10000(2,"1万以上"),
|
||||
BELOW_1000(0,"1000以下",10),
|
||||
TO_1000_10000(1,"1000-1万",20),
|
||||
MORE_THAN_10000(2,"1万以上",30),
|
||||
|
||||
|
||||
|
||||
@@ -16,10 +16,12 @@ public enum PassengerFlowEnum {
|
||||
|
||||
private Integer code;
|
||||
private String desc;
|
||||
private Integer type;
|
||||
|
||||
PassengerFlowEnum(Integer code, String desc) {
|
||||
PassengerFlowEnum(Integer code, String desc,Integer type) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
@@ -38,6 +40,14 @@ public enum PassengerFlowEnum {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static final Map<Integer, PassengerFlowEnum> map
|
||||
= Arrays.stream(values()).collect(Collectors.toMap(PassengerFlowEnum::getCode, Function.identity()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user