package com.ym.mec.auth.dal.enums;

import com.ym.mec.common.enums.BaseEnum;

/** 
 * @author sunzl 
 * 2015年8月25日 下午4:19:00 
 * 会员状态枚举类
 */
public enum UserStatus implements BaseEnum<Integer, UserStatus> {

	NOACTIVATED(0, "未激活"), CANCELLED(-1, "注销"), NORMAL(1, "正常"), LOCKED(2, "锁定");

	private int code;

	private UserStatus(int code, String remark) {
		this.code = code;
		this.remark = remark;
	}

	private String remark;

	public Integer getCode() {
		return code;
	}

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

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public static UserStatus codeOf(int code) {
		for (UserStatus userStatus : UserStatus.values()) {
			if (code == userStatus.getCode()) {
				return userStatus;
			}
		}
		return null;
	}
}
