package com.prolog.rdc.tms.app.constant.enums;

import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * 调度承运商策略匹配类型
 * @author hongbo.pan
 * @date 2022/11/25
 */
@AllArgsConstructor
@Getter
public enum DispatchMatchCarrierTypeEnum {

    NON("0", "未匹配"),
    CARRIER("1", "承运商"),
    DRIVER_VEHICLE("2", "司机、车辆"),
    ;

    private static Map<String, DispatchMatchCarrierTypeEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

    static {
        for(DispatchMatchCarrierTypeEnum as : DispatchMatchCarrierTypeEnum.values()) {
            enumMap.put(as.code, as);
        }
    }

    public static DispatchMatchCarrierTypeEnum getByCode(String code) {
        return  enumMap.get(code);
    }

}
