gdg
2020-12-23 6207311d7df3d47d27fdd78de33f49875550f52f
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.nanometer.smartlab.entity.enumtype;
 
 
 
import java.util.*;
 
public enum ReplaceDictType {
 
    factory (1, "厂家"),
    specifications(2, "规格"),
    packing(3, "包装");
 
 
    private int key;
 
    private String type;
 
    ReplaceDictType(int key, String type){
        this.key = key;
        this.type = type;
    }
 
 
    public int getKey() {
        return key;
    }
 
    public String getType() {
        return type;
    }
 
    private static HashMap<Integer,ReplaceDictType> map = new HashMap<Integer,ReplaceDictType>();
 
    static {
        for(ReplaceDictType d : ReplaceDictType.values()){
            map.put(d.key, d);
        }
 
    }
 
    public static ReplaceDictType parse(Integer index) {
        if(map.containsKey(index)){
            return map.get(index);
        }
        return null;
    }
 
 
 
}