package com.goafanti.app.enums;

import java.util.HashMap;
import java.util.Map;

public enum MyAppCountCategory {
	COLLECTIONS("collections", "收藏"),
	ORDERS("orders", "订单"),
	MYDEMAND("mydemand", "我的需求"),
	MYTECH("mytech", "我的技术"),
	MYEXPERT("myexpert", "我的专家"),
	UNKNOWN("", "未知");

	private MyAppCountCategory(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	private static Map<String, MyAppCountCategory> status = new HashMap<String, MyAppCountCategory>();

	static {
		for (MyAppCountCategory value : MyAppCountCategory.values()) {
			status.put(value.getCode(), value);
		}
	}

	public static MyAppCountCategory getStatus(String code) {
		if (containsType(code)) {
			return status.get(code);
		}
		return UNKNOWN;
	}

	public static boolean containsType(String code) {
		return status.containsKey(code);
	}

	private String	code;
	private String	desc;

	public String getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}
}
