package cn.estsh.i3plus.pojo.base.enumutil;

import java.math.BigDecimal;
import java.net.URL;
import java.sql.*;
import java.util.List;
import java.util.Map;

/**
 * @author Wynne.Lu
 * @date 2021/3/22 下午5:16
 * @desc
 */
public class ScreenEnumUtil {

    public enum DATA_OBJECT_SOURCE {
        TABLE(1, "TABLE", "数据库表"),
        VIEW(2, "VIEW", "数据库视图");

        private Integer value;
        private String code;
        private String description;

        DATA_OBJECT_SOURCE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static Integer codeOfValue(String code) {
            Integer tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static DATA_OBJECT_SOURCE valueOfEnum(Integer value) {
            DATA_OBJECT_SOURCE tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value.equals(value)) {
                    tmp = values()[i];
                }
            }
            return tmp;
        }
    }

    public enum DEVICE_TYPE {
        PC(10, "PC", "PC端"),
        APP(20, "APP", "移动端");

        private Integer value;
        private String code;
        private String description;

        DEVICE_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum NULLABLE {
        YES(10, "YES", "允许为空"),
        NO(20, "NO", "不允许为空");

        private Integer value;
        private String code;
        private String description;

        NULLABLE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static NULLABLE valueOfEnum(Integer value) {
            NULLABLE tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value.equals(value)) {
                    tmp = values()[i];
                }
            }
            return tmp;
        }
    }

    public enum INDEX_TYPE {
        PRIMARY(10, "PRIMARY", "主键"),
        NORMAL(20, "NORMAL", "普通索引"),
        UNIQUE(30, "UNIQUE", "唯一键");

        private Integer value;
        private String code;
        private String description;

        INDEX_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum DEFAULT_FIELD_IN_DB {
        CREATE_DATE_TIME("createDatetime", "create_date_time", "创建时间"),
        MODIFY_DATE_TIME("modifyDatetime", "modify_date_time", "修改时间"),
        IS_VALID("isValid", "is_valid", "是否有效"),
        IS_DELETED("isDeleted", "is_deleted", "是否弱删");

        private String code;
        private String codeDb;
        private String description;

        DEFAULT_FIELD_IN_DB(String code, String codeDb, String description) {
            this.code = code;
            this.codeDb = codeDb;
            this.description = description;
        }

        public String getCode() {
            return code;
        }

        public String getCodeDb() {
            return codeDb;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum ACTION_TYPE {
        FRONT(10, "FRONT", "前端动作"),
        BACK(20, "BACK", "后端动作");

        private Integer value;
        private String code;
        private String description;

        ACTION_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }


    }

    public enum DATASOURCE_CONNECTION_STATUS {
        TEST(10, "test", "待连接测试"),
        SUCCESS(20, "success", "连接成功"),
        FAILED(30, "failed", "连接失败");

        private Integer value;
        private String code;
        private String description;

        DATASOURCE_CONNECTION_STATUS(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum ACTION {
        SEARCH(10, "search", "查询", "scrSearchActionStrategy"),
        CREATE(20, "create", "保存", "scrCreateActionStrategy"),
        UPDATE(30, "update", "更新", "scrUpdateActionStrategy"),
        DELETE(40, "delete", "删除", "scrDeleteActionStrategy"),
        VALID(50, "valid", "启用", "scrValidActionStrategy"),
        INVALID(60, "invalid", "禁用", "scrInvalidActionStrategy"),
        SEARCH_PAGER(70, "searchPager", "分页查询", "scrSearchPagerActionStrategy"),
        ENUM(80, "enum", "枚举查询", "scrEnumActionStrategy"),
        DIRECT(90, "direct", "跳转", "scrDirectActionStrategy"),
        DOWNLOAD(100, "download", "下载", "scrDownloadActionStrategy"),
        UPLOAD(110, "upload", "上传", "scrUploadActionStrategy"),
        INVOKE(120, "invoke", "调用", "scrInvokeActionStrategy");

        private Integer value;
        private String code;
        private String description;
        private String beanName;

        ACTION(Integer value, String code, String description, String beanName) {
            this.value = value;
            this.code = code;
            this.description = description;
            this.beanName = beanName;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String beanOfCode(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equalsIgnoreCase(code)) {
                    tmp = values()[i].beanName;
                }
            }
            return tmp;
        }

        public static ACTION codeOfEnum(String code) {
            ACTION tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equalsIgnoreCase(code)) {
                    tmp = values()[i];
                }
            }
            return tmp;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }


    public enum COMMUNICATION_TYPE {
        HTTP(10, "HTTP", "Http"),
        WEBSOCKET(20, "WEBSOCKET", "WebSocket");

        private Integer value;
        private String code;
        private String description;

        COMMUNICATION_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum DATA_RESOURCE_TYPE {
        ENUM(10, "ENUM", "枚举"),
        WEBSOCKET(20, "WEBSOCKET", "WebSocket");

        private Integer value;
        private String code;
        private String description;

        DATA_RESOURCE_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum MODEL_TYPE {
        DATA_OBJECT(10, "DATA_OBJECT", "数据库对应类型"),
        INNER_MODEL(20, "INNER_MODEL", "程序内部对应类型"),
        CUSTOMIZE(30, "CUSTOMIZE", "用户自定义类型");

        private Integer value;
        private String code;
        private String description;

        MODEL_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum DATETIME_FORMAT {
        DATETIME(10, "yyyy-MM-dd HH:mm:ss", "日期"),
        DATE(20, "yyyy-MM-dd", "日期"),
        TIME(30, "HH:mm:ss", "时间"),
        TIME_NO_SECOND(40, "HH:mm", "时间（无秒）");


        private Integer value;
        private String code;
        private String description;

        DATETIME_FORMAT(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum MODEL_FIELD_SOURCE {
        FORM_TEXT(10, "TEXT", "文本"),
        FORM_NUMBER(20, "NUMBER", "数字"),
        FORM_PASSWORD(30, "PASSWORD", "密码"),
        FORM_DATETIME(40, "DATETIME", "时间"),
        FORM_PICK_UP(50, "PICK_UP", "拾取"),
        FORM_ENUM(60, "ENUM", "枚举"),
        FORM_DICTIONARY(70, "DICTIONARY", "字典");

        private Integer value;
        private String code;
        private String description;

        MODEL_FIELD_SOURCE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum AUTH_TYPE {
        ROW(10, "ROW", "行"),
        COLUMN(20, "COLUMN", "列");

        private Integer value;
        private String code;
        private String description;

        AUTH_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum JDBC_TYPES {
        BIT(Types.BIT, "BIT", Boolean.class),
        TINYINT(Types.TINYINT, "TINYINT", Byte.class),
        SMALLINT(Types.SMALLINT, "SMALLINT", Short.class),
        INTEGER(Types.INTEGER, "INTEGER", Integer.class),
        BIGINT(Types.BIGINT, "BIGINT", Long.class),
        FLOAT(Types.FLOAT, "FLOAT", Double.class),
        REAL(Types.REAL, "REAL", Float.class),
        DOUBLE(Types.DOUBLE, "DOUBLE", Double.class),
        NUMERIC(Types.NUMERIC, "NUMERIC", BigDecimal.class),
        DECIMAL(Types.DECIMAL, "DECIMAL", BigDecimal.class),
        CHAR(Types.CHAR, "CHAR", String.class),
        VARCHAR(Types.VARCHAR, "VARCHAR", String.class),
        LONGNVARCHAR(Types.LONGNVARCHAR, "LONGNVARCHAR", String.class),
        DATE(Types.DATE, "DATE", Date.class),
        TIME(Types.TIME, "TIME", Time.class),
        TIMESTAMP(Types.TIMESTAMP, "TIMESTAMP", Timestamp.class),
        BINARY(Types.BINARY, "BINARY", Byte[].class),
        VARBINARY(Types.VARBINARY, "VARBINARY", Byte[].class),
        LONGVARBINARY(Types.LONGVARBINARY, "LONGVARBINARY", Byte[].class),
        STRUCT(Types.STRUCT, "STRUCT", Struct.class),
        ARRAY(Types.ARRAY, "ARRAY", Array.class),
        BLOB(Types.BLOB, "BLOB", Blob.class),
        CLOB(Types.CLOB, "CLOB", Clob.class),
        REF(Types.REF, "REF", Ref.class),
        DATALINK(Types.DATALINK, "DATALINK", URL.class),
        BOOLEAN(Types.BOOLEAN, "BOOLEAN", Boolean.class),
        NCHAR(Types.NCHAR, "NCHAR", String.class),
        NVARCHAR(Types.NVARCHAR, "NVARCHAR", String.class),
        LONGVARCHAR(Types.LONGVARCHAR, "LONGVARCHAR", String.class),
        NCLOB(Types.NCLOB, "NCLOB", NClob.class),
        SQLXML(Types.SQLXML, "SQLXML", String.class);

        private Integer value;
        private String code;
        private Class clazz;

        JDBC_TYPES(Integer value, String code, Class clazz) {
            this.value = value;
            this.code = code;
            this.clazz = clazz;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public Class getClazz() {
            return clazz;
        }

        public static Integer valueOfCode(String code) {
            Integer tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static JDBC_TYPES valueOfEnum(Integer value) {
            JDBC_TYPES tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value.equals(value)) {
                    tmp = values()[i];
                }
            }
            return tmp;
        }

        public static Class clazzOfEnum(Class clazz) {
            Class tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].clazz.equals(clazz)) {
                    tmp = values()[i].clazz;
                }
            }
            return tmp;
        }
    }


    public enum JAVA_TYPES {
        BOOLEAN(10, "Boolean", Boolean.class),
        BYTE(20, "Byte", Byte.class),
        BYTE_ARR(30, "Byte[]", Byte[].class),
        SHORT(40, "Short", Short.class),
        INTEGER(50, "Integer", Integer.class),
        LONG(60, "Long", Long.class),
        DOUBLE(70, "Double", Double.class),
        FLOAT(80, "Float", Float.class),
        BIG_DECIMAL(90, "BigDecimal", BigDecimal.class),
        STRING(100, "String", String.class),
        DATE(110, "Date", Date.class),
        TIME(120, "Time", Time.class),
        TIMESTAMP(130, "Timestamp", Timestamp.class),
        ARRAY(140, "Array", Array.class),
        LIST(150, "List", List.class),
        MAP(160, "Map", Map.class),
        OBJECT(170, "Object", Object.class);

        private Integer value;
        private String code;
        private Class clazz;

        JAVA_TYPES(Integer value, String code, Class clazz) {
            this.value = value;
            this.code = code;
            this.clazz = clazz;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public Class getClazz() {
            return clazz;
        }

        public static Integer valueOfCode(String code) {
            Integer tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].value;
                }
            }
            return tmp;
        }

        public static JAVA_TYPES valueOfEnum(Integer value) {
            JAVA_TYPES tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value.equals(value)) {
                    tmp = values()[i];
                }
            }
            return tmp;
        }

        public static JAVA_TYPES clazzOfEnum(Class clazz) {
            JAVA_TYPES tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].clazz.equals(clazz)) {
                    tmp = values()[i];
                }
            }
            if (tmp == null) {
                return OBJECT;
            }
            return tmp;
        }
    }

    public enum AUTH_ACCESS_TYPE {
        NO_AUTH(10, "NO_AUTH", "无权限"),
        READONLY(20, "READONLY", "只读");

        private Integer value;
        private String code;
        private String description;

        AUTH_ACCESS_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum AUTH_KIND_TYPE {
        USER(10, "USER", "用户"),
        ROLE(20, "ROLE", "角色");

        private Integer value;
        private String code;
        private String description;

        AUTH_KIND_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum INNER_MESSAGE_TYPE {
        DATASOURCE_BEAN_REFRESH(10, "DATASOURCE_BEAN_REFRESH", "刷新Spring容器中的数据源Bean");

        private Integer value;
        private String code;
        private String description;

        INNER_MESSAGE_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }

        public static String valueOfDescription(Integer value) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value.equals(value)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum OPERATION_TYPE {
        CREATE(10, "create", "新增"),
        UPDATE(20, "update", "修改"),
        DELETE(30, "delete", "删除"),
        WEAKLY_DELETE(40, "invalid", "弱删"),
        VALID(50, "valid", "启用"),
        INVALID(60, "invalid", "禁用");

        private Integer value;
        private String code;
        private String description;

        OPERATION_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static OPERATION_TYPE valueOfEnum(Integer value) {
            OPERATION_TYPE tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value.equals(value)) {
                    tmp = values()[i];
                }
            }
            return tmp;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum TEMPLATE_TYPE {
        EMPTY(10, "empty", "空白模板"),
        SPA(20, "spa", "单页应用模板");

        private Integer value;
        private String code;
        private String description;

        TEMPLATE_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static TEMPLATE_TYPE valueOfEnum(Integer value) {
            TEMPLATE_TYPE tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value.equals(value)) {
                    tmp = values()[i];
                }
            }
            return tmp;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    public enum LAYOUT_REF_TYPE {
        PANEL(10, "Panel", "容器"),
        SCREEN(20, "Screen", "页面");

        private Integer value;
        private String code;
        private String description;

        LAYOUT_REF_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static LAYOUT_REF_TYPE valueOfEnum(Integer value) {
            LAYOUT_REF_TYPE tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value.equals(value)) {
                    tmp = values()[i];
                }
            }
            return tmp;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }

    /**
     * 等待平台枚举抽入数据库或redis
     */
    public enum ENUM_SOFT_TYPE {
        COMMON(10, "CommonEnumUtil", "通用枚举"),
        IMPP(20, "ImppEnumUtil", "平台枚举"),
        WMS(30, "WmsEnumUtil", "WMS枚举"),
        SWEB(40, "SwebEnumUtil", "Sweb枚举"),
        MES(50, "MesEnumUtil", "Mes枚举"),
        MES_PCN(60, "MesPcnEnumUtil", "MesPcn枚举"),
        ANDON(70, "AndonEnumUtil", "Andon枚举"),
        APS(80, "ApsEnumUtil", "Aps枚举"),
        BLOCK_FORM(90, "BlockFormEnumUtil", "动态表单枚举"),
        BLOCK_REPORT(100, "BlockReportEnumUtil", "动态报表枚举"),
        BLOCK_SOFT_SWITCH(110, "BlockSoftSwitchEnumUtil", "软适配枚举"),
        LAC(120, "LacEnumUtil", "Lac枚举"),
        MDM(130, "MdmEnumUtil", "主数据中心枚举"),
        PTL(140, "PtlEnumUtil", "Ptl枚举"),
        PTL_PCN(150, "PtlPcnEnumUtil", "PtlPcn枚举"),
        SCREEN(160, "ScreenEnumUtil", "通用界面枚举");

        private Integer value;
        private String code;
        private String description;

        ENUM_SOFT_TYPE(Integer value, String code, String description) {
            this.value = value;
            this.code = code;
            this.description = description;
        }

        public Integer getValue() {
            return value;
        }

        public String getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }

        public static ENUM_SOFT_TYPE valueOfEnum(Integer value) {
            ENUM_SOFT_TYPE tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].value.equals(value)) {
                    tmp = values()[i];
                }
            }
            return tmp;
        }

        public static String codeOfDescription(String code) {
            String tmp = null;
            for (int i = 0; i < values().length; i++) {
                if (values()[i].code.equals(code)) {
                    tmp = values()[i].description;
                }
            }
            return tmp;
        }
    }
}
