package com.sundot.airport.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 设备台账颜色类型枚举
 */
@Getter
@AllArgsConstructor
public enum EquipmentColorTypeEnum {

    COLORLESS("COLORLESS", "无色"),
    RED("RED", "红色"),
    ORANGE("ORANGE", "橙色"),
    YELLOW("YELLOW", "黄色"),
    MIXED("MIXED", "混合");

    private final String code;
    private final String desc;

    public static EquipmentColorTypeEnum getByCode(String code) {
        for (EquipmentColorTypeEnum itemEnum : values()) {
            if (itemEnum.getCode().equals(code)) {
                return itemEnum;
            }
        }
        return null;
    }

}
