package com.iailab.module.data.common.enums; import lombok.AllArgsConstructor; import lombok.Getter; /** * @author PanZhibao * @Description * @createTime 2024年05月12日 */ @Getter @AllArgsConstructor public enum DataSourceType { OPCUA("OPCUA", "OPC UA"), OPCDA("OPCDA", "OPC DA"), ModBus("ModBus", "ModBus"), KIO("KIO", "KIO"), HTTP("HTTP", "HTTP"); private String code; private String desc; public static DataSourceType getEumByCode(String code) { if (code == null) { return null; } for (DataSourceType statusEnum : DataSourceType.values()) { if (statusEnum.getCode().equals(code)) { return statusEnum; } } return null; } }