package com.unis.detectionnum.server.aenum;

/**
 * 告警级别
 */
public enum ForwardModeEnum {
    SMS(1, "sms"), MAIL(0, "mail");
    private int    id;

    private String name;

    private ForwardModeEnum(final int id, final String name) {
        this.id = id;
        this.name = name;
    }

    /**
     * @return the id
     */
    public final int getId() {
        return this.id;
    }

    /**
     * @return the name
     */
    public final String getName() {
        return this.name;
    }

    public static ForwardModeEnum parse(final int id) {
        for (final ForwardModeEnum fowwardMode : ForwardModeEnum.values()) {
            if (id == fowwardMode.getId()) {
                return fowwardMode;
            }
        }
        return null;
    }

}
