package com.cftech.membercard.model;

/**
 * Created by lisw on 2017/10/11.
 */
public enum mCardDMSCode {
    blue("0", "0001"), silver("1","0002"), yellow("2","0003"), purple("3", "0004"), black("4", "0005");
    // 成员变量
    private String name;
    private String index;
    // 构造方法
    private mCardDMSCode(String name, String index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(String index) {
        for (mCardDMSCode c : mCardDMSCode.values()) {
            if (c.getIndex().equals(index)) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getIndex() {
        return index;
    }
    public void setIndex(String index) {
        this.index = index;
    }

}
