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 StoreOperatorEnum {
    FRANCHISEE(10,"加盟商"),
    STORE_MANAGER(20,"店长"),



    ;

    private Integer code;
    private String desc;

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

    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 static final Map<Integer, StoreOperatorEnum> map
            = Arrays.stream(values()).collect(Collectors.toMap(StoreOperatorEnum::getCode, Function.identity()));

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