package com.sckw.fleet.model.enums;

import lombok.Getter;

/**
 * @author zk
 * @desc 车辆能源类型
 * @date 2024/3/8 0008
 */
@Getter
public enum TruckEnergyTypeEnum {
    /**
     * 传统能源车辆
     */
    TRADITIONAL(1, "传统能源车辆"),

    /**
     * 新能源车辆
     */
    NEW_ENERGY(2, "新能源车辆")

    ;


    private final Integer code;
    private final String name;

    TruckEnergyTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(Integer code) {
        for (TruckEnergyTypeEnum entity : TruckEnergyTypeEnum.values()) {
            if (entity.getCode().equals(code)) {
                return entity.getName();
            }
        }
        return null;
    }
}
