liusuyi
2025-12-19 b2ce863ccd86aa2b7e308e0f8098fc0b932f57eb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.ard.device.component.sdk.factory;
 
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);
    }
}