package com.hs.admin.bean;

/**
 * @author xieheng
 */

public enum OperateEnum {

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

    OperateEnum(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) {
        OperateEnum[] values = OperateEnum.values();

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

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