package com.gci.boot.enums;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author lyz
 * @date 2023/10/23 14:09
 */
public enum VehicleGpsType {
    /**
     * 车辆gps分析类型
     */
    Driving_Not_Work(1, "行驶未作业"),
    Driving_Work(2, "行驶作业"),
    Stopped_Work(3, "停靠作业"),
    Stopped_NOT_Work(4, "停靠未作业");

    private final int value;
    private final String desc;

    VehicleGpsType(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getName(int value) {
        VehicleGpsType type = Arrays.stream(VehicleGpsType.values()).filter(a -> {
            return a.value == value;
        }).findFirst().orElse(null);
        return Objects.nonNull(type) ? type.getDesc() : "";
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

}
