public enum AuditEnum  {
    PASS("PASS","pass","passed", "通过"),
    UNPASS("UNPASS","unpass","unpass", "不通过"),
    UNAUDIT("UNAUDIT", "unaudit", "unaudit", "推迟审核"),
    AUDITING("AUDITING", null,null,"审核中");

    private static final Map<String, String> MAPPING = new LinkedHashMap<String, String>();
    private static final Map<String, String> INVERSE_MAPPING = new LinkedHashMap<String, String>();

   
    private String value;
    private String kw;
    private String wlk;
    private String text;

    static {
        for (AuditEnum em : AuditEnum.values()) {
            MAPPING.put(em.getText(), em.getValue());
            INVERSE_MAPPING.put(em.getValue(), em.getText());
        }
    }

    AuditEnum(final String value,  final String kw, final String wlk,final String text) {
        this.value = value;
        this.text = text;
        this.kw = kw;
        this.wlk = wlk;
    }

    public String getValue() {
        return value;
    }

    
    public String getText() {
        return text;
    }
    
    
    public static AuditEnum get(String enumValue) {
        for (AuditEnum em : AuditEnum.values()) {
            if (em.getValue().equals(enumValue)) {
                return em;
            }
        }
        throw new IllegalArgumentException("Can't get enum with this enumValue.");
    }


    public static Map<String, String> mapping() {
        return MAPPING;
    }

    public static Map<String, String> inverseMapping() {
        return INVERSE_MAPPING;
    }

    public String getKw() {
        return kw;
    }

    public String getWlk() {
        return wlk;
    }
    
}

 

posted on 2015-12-16 09:50  网络终结者  阅读(175)  评论(0)    收藏  举报