package com.goafanti.common.enums;

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

public enum PatentInfoFields {
	
	UID("uid", "用户id"),
	CONTACTS("contacts", "联系人"),
	PATENTNAME("patentName", "专利名称"),
	PATENTCATAGORY("patentCatagory", "专利类别"),
	PATENTNUMBER("patentNumber", "专利号/申请号"),
	PATENTFIELD("patentField", "专利领域"),
	PATENTDES("patentDes", "专利简介"),
	FIRSTINVENTORNAME("firstInventorName", "第一发明人姓名"),
	FIRSTINVENTORNATIONALITY("firstInventorNationality", "第一发明人国籍"),
	FIRSTINVENTORIDNUMBER("firstInventorIdNumber", "第一发明人身份证号"),
	FIRSTINVENTORISPUBLISH("firstInventorIsPublish", "第一发明人是否公布"),
	SECONDINVENTORNAME("secondInventorName", "第二发明人姓名"),
	SECONDINVENTORNATIONALITY("secondInventorNationality", "第二发明人国籍"),
	SECONDINVENTORISPUBLISH("secondInventorIsPublish", "第二发明人是否公布"),
	THIRDINVENTORNAME("thirdInventorName", "第三发明人姓名"),
	THIRDINVENTORNATIONALITY("thirdInventorNationality", "第三发明人国籍"),
	THIRDINVENTORISPUBLISH("thirdInventorIsPublish", "第三发明人是否公布"),
	PATENTPRORYSTATEMENTURL("patentProryStatementUrl", "专利代理委托书URL"),
	PATENTWRITINGURL("patentWritingUrl", "专利稿件URL"),
	AUTHORIZATIONNOTICEURL("authorizationNoticeUrl", "授权通知书URL"),
	PATENTCERTIFICATEURL("patentCertificateUrl", "专利证书URL"),
	STATE("state", "专利状态"),
	PRINCIPAL("principal", "负责人"),
	COMMENT("comment", "备注"),
	OFFICE("office", "事务所"),
	AUTHOR("author", "资料撰写人"),
	SALESMAN("salesman", "营销员"),
	OTHER("", "未知参数");
	
	
	private String	code;
	private String	desc;
	
	private static Map<String, PatentInfoFields> status = new HashMap<String, PatentInfoFields>();
	
	private PatentInfoFields(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	static {
		for (PatentInfoFields value : PatentInfoFields.values()) {
			status.put(value.getCode(), value);
		}
	}
	
	public static PatentInfoFields 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;
	}
}
