package com.cool.store.enums.prepare.newStore;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

public enum PassengerFlowEnum {
    BELOW_1000(0,"1000以下",10),
    TO_1000_10000(1,"1千-1万",20),
    MORE_THAN_10000(2,"1万以上",30),



    ;

    private Integer code;
    private String desc;
    private Integer type;

    PassengerFlowEnum(Integer code, String desc,Integer type) {
        this.code = code;
        this.desc = desc;
        this.type = type;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        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()));

    public static PassengerFlowEnum getByCode(Integer code) {
        return map.get(code);
    }
}
