package com.ruoyi.device.mqtt.enums;

/**
 * 版本枚举
 *
 * @author lwm
 */
public enum VersionEnum
{
    FIRST(0x01),
    SECOND(0x02),
    THIRD(0x03),
    NINE(0x09),
    AUTO(0xFF);

    private final int value;

    VersionEnum(int value)
    {
        this.value = value;
    }

    public int getValue()
    {
        return value;
    }

    public static VersionEnum getVersion(int version)
    {
        for (VersionEnum versionEnum : VersionEnum.values())
        {
            if (version == versionEnum.getValue())
            {
                return versionEnum;
            }
        }
        return null;
    }
}
