lyfO_o
2021-06-16 0b0d7c1efa03ba43ccd21f9b89b1b7f359db7961
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
package com.nanometer.smartlab.entity.enumtype;
 
import java.util.HashMap;
 
public enum StoreType {
    APPLY(1, "申购"), DIRECTSTORE(2, "直接入库");
    private int key;
 
    private String text;
 
    private StoreType(int key, String text) {
        this.key = key;
        this.text = text;
    }
 
    public int getKey() {
        return key;
    }
 
    public String getText() {
        return text;
    }
 
    private static HashMap<Integer,StoreType> map = new HashMap<Integer,StoreType>();
    static {
        for(StoreType d : StoreType.values()){
            map.put(d.key, d);
        }
    }
    
    public static StoreType parse(Integer index) {
        if(map.containsKey(index)){
            return map.get(index);
        }
        return null;
    }
}