package com.goafanti.common.enums;

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

public enum PatentRegistrationFields {
	
	ACCEPTANCERECEIVETIME("acceptanceReceiveTime", "用户id"),
	ACCEPTANCEISSUETIME("acceptanceIssueTime", "联系人"),
	ACCEPTANCETRACKINGNUMBER("acceptanceTrackingNumber", "专利名称"),
	ACCEPTANCEEXPRESSCOMPANY("acceptanceExpressCompany", "专利类别"),
	
	AUTHORIZATIONRECEIVETIME("authorizationReceiveTime", "专利号/申请号"),
	AUTHORIZATIONISSUETIME("authorizationIssueTime", "专利领域"),
	AUTHORIZATIONTRACKINGNUMBER("authorizationTrackingNumber", "专利简介"),
	AUTHORIZATIONEXPRESSCOMPANY("authorizationExpressCompany", "第一发明人姓名"),
	
	CERTIFICATERECIEVETIME("certificateRecieveTime", "第一发明人国籍"),
	CERTIFICATEISSUETIME("certificateIssueTime", "第一发明人身份证号"),
	CERTIFICATETRACKINGNUMBER("certificateTrackingNumber", "第一发明人是否公布"),
	CERTIFICATEEXPRESSCOMPANY("certificateExpressCompany", "第二发明人姓名"),
	
	OTHER("", "未知参数");
	
	
	private String	code;
	private String	desc;
	
	private static Map<String, PatentRegistrationFields> status = new HashMap<String, PatentRegistrationFields>();
	
	private PatentRegistrationFields(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	static {
		for (PatentRegistrationFields value : PatentRegistrationFields.values()) {
			status.put(value.getCode(), value);
		}
	}
	
	public static PatentRegistrationFields 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;
	}
	
	

}
