package com.vci.web.enumpck; import com.vci.common.portal.enums.GetByType; import com.vci.constant.PortalVIEnumConstant; import com.vci.starter.web.annotation.VciEnum; /** * 表单标记类型 * @author xiej * */ @VciEnum(name = PortalVIEnumConstant.PORTALVI_VI_FLAG,text = "表单所属业务类型枚举") public enum PortalVITypeFlag { LinkType("LinkType", "链接类型的表单", (short)1), BtmType("BtmType", "业务类型的表单", (short)0); private String name = ""; private String label = ""; private short intVal = 1; private PortalVITypeFlag(String name, String label, short intVal){ this.name = name; this.label = label; this.intVal = intVal; } public static PortalVITypeFlag getByName(String name){ PortalVITypeFlag res = getByType(GetByType.Name, name); return res; } public static PortalVITypeFlag getByLabel(String label){ PortalVITypeFlag res = getByType(GetByType.Label, label); return res; } public static PortalVITypeFlag getByIntVal(int intVal){ PortalVITypeFlag res = getByType(GetByType.IntVal, String.valueOf(intVal)); return res; } public static PortalVITypeFlag getByType(GetByType type, String val){ PortalVITypeFlag[] alls = getAll(); PortalVITypeFlag res = null; for(PortalVITypeFlag obj : alls){ if(type == GetByType.Name && obj.getName().equalsIgnoreCase(val)){ res = obj; break; } else if(type == GetByType.Label && obj.getLabel().equalsIgnoreCase(val)){ res = obj; break; } else if(type == GetByType.IntVal && String.valueOf(obj.getIntVal()).equalsIgnoreCase(val)){ res = obj; break; } } return res; } public static PortalVITypeFlag[] getAll(){ return PortalVITypeFlag.values(); } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } public short getIntVal() { return intVal; } public void setIntVal(short intVal) { this.intVal = intVal; } }