package com.hs.admin.base;

/**
 * @author xieheng
 */

public enum CommandEnum {

    /**
     *
     */
    SEND("1", "SEND"),
    PAUSE("2", "Pause"),
    DELETE("3", "Delete"),
    RESUME("4", "Resume");

    private String code;
    private String msg;

    CommandEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static boolean exists(String code) {
        CommandEnum[] values = CommandEnum.values();

        for (CommandEnum commandEnum : values) {
            if (commandEnum.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        System.out.println(exists("1"));
    }
}
