ModulesEnum.java 954 Bytes
package com.polysoft.nafmii.enums;

public enum ModulesEnum {

    HOME("home", "home",  "file:///android_asset/dist/index.html#/"),
    MEMBER("member", "home","file:///android_asset/dist/index.html#/home"),
    LEARN("learn", "learn", "http://debugtbs.qq.com"),
    MY("my", "home","file:///android_asset/dist/index.html#/user/center");

    public final String name;
    public final String fmtKey;
    public final String webUrl;

    ModulesEnum(String name, String fmtKey, String url) {
        this.name = name;
        this.fmtKey = fmtKey;
        this.webUrl = url;
    }

    public static ModulesEnum findModule(String name) {
        if (HOME.name.equals(name)) {
            return HOME;
        } else if (MEMBER.name.equals(name)) {
            return MEMBER;
        } else if (LEARN.name.equals(name)) {
            return LEARN;
        } else if (MY.name.equals(name)) {
            return MY;
        }
        return null;
    }

}