package com.goafanti.common.enums;

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

public enum UserAbilityFields {
	
	UID("uid", "用户id"),
	ABILITYLABEL("abilityLabel", "能力标签"),
	INTELLECTRIGHT("intellectRight", "知识产权对企业竞争力的作用 "),
	SCIENCEACHIEVEMENT("scienceAchievement", "科技成果转化情况"),
	RESEARCHINNOVATION("researchInnovation", "研究开发与技术创新组织管理情况"),
	PERSONNEL("personnel", " 管理与科技人员情况"),
	
	OTHER("", "未知参数");
	
	private String	code;
	private String	desc;
	
	private static Map<String, UserAbilityFields> status = new HashMap<String, UserAbilityFields>();
	
	private UserAbilityFields(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	static {
		for (UserAbilityFields value : UserAbilityFields.values()) {
			status.put(value.getCode(), value);
		}
	}
	
	public static UserAbilityFields getField(String code) {
		if (containsType(code)) {
			return status.get(code);
		}
		return OTHER;
	}
	
	public static String getFieldDesc(String code) {
		return getField(code).getDesc();
	}

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

	public String getDesc() {
		return desc;
	}

}
