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 2023/8/23
 */
@AllArgsConstructor
@Getter
public enum IntelligentLockEnum {

    UN_LOCK(0, "未锁"),
    LOCK(1, "已锁"),
    ;

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

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

    public static IntelligentLockEnum getByCode(Integer code) {
        return  enumMap.get(code);
    }

}
