package com.ard.device.component.sdk.common; public enum FactoryType { HIKVISION("1"), DAHUA("2"); private final String factoryCode; FactoryType(String factoryCode) { this.factoryCode = factoryCode; } public String getFactoryCode() { return factoryCode; } public static FactoryType fromCode(String code) { for (FactoryType type : FactoryType.values()) { if (type.getFactoryCode().equals(code)) { return type; } } throw new IllegalArgumentException("Unsupported factory code: " + code); } }