编辑
键值管理
本文访问次数:0
/**
 * Created by zongren on 2016/3/23.
 * Used in putExtra and getExtra functions.
 */
public enum EXTRA_KEY {
    PARENT_CATEGORY_ID,
    URL,
    BREAD_CRUMB,
    HTML,
    CATEGORY,
    LIST_VIEW_DATA,
    GOODS_ID,
    ORDER_ID;

    @Override
    public String toString(){
        return "me.zongren.android.EXTRA_KEY_" + super.toString();
    }

    public String getValue() {
        return toString();
    }

    public EXTRA_KEY getExtraKey(String value){
        for(EXTRA_KEY extraKey:values()){
            if(extraKey.toString().equals(value)){
                return extraKey;
            }
        }
        throw new IllegalArgumentException();
    }
}
没有任何评论