package com.yeejoin.equipmanage.common.utils;

public enum FileUploadTypeEnum {
	EQUIPMENT_DEF("EQUIPMENT_DEF","装备定义"),//装备定义
	EQUIPMENT_POINT("EQUIPMENT_POINT", "消防点位");
	
	
	
	
	private String type;
	private String name;
	
	private FileUploadTypeEnum(String type,String name){
		this.setType(type);
		this.setName(name);
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public static String getName(String code) {
		for(FileUploadTypeEnum type: FileUploadTypeEnum.values()) {
			if (type.getType().equals(code)) {
				return type.getName();
			}
		}
		return null;
	}
	
	public static FileUploadTypeEnum getEnum(String code) {
		FileUploadTypeEnum fileUploadTypeEnum = null;
		for(FileUploadTypeEnum type: FileUploadTypeEnum.values()) {
			if (type.getType().equals(code)) {
				fileUploadTypeEnum = type;
				break;
			}
		}
		return fileUploadTypeEnum;
	}
}
