yanghb
2024-12-17 1287337fd0b0c156ec79712f9a600ebeffefe3a6
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
package com.zzg.common.enums;
 
import lombok.AllArgsConstructor;
import lombok.Getter;
 
@Getter
@AllArgsConstructor
public enum HouseProductionTypeEnum {
    PRIVATE_USE(1, "私产"),
    PUBLIC_USE(2, "公产");
    private final Integer value;
 
    private final String text;
 
    public static String getValueByKey(Integer key) {
        for (HouseProductionTypeEnum v : HouseProductionTypeEnum.values()) {
            if (v.getValue().equals(key)) {
                return v.getText();
            }
        }
        return "";
    }
 
    public static String getText(Integer key) {
        for (HouseProductionTypeEnum v : HouseProductionTypeEnum.values()) {
            if (key.equals(v.getValue())) {
                return v.getText();
            }
        }
        return "";
    }
    public static Integer getValue(String text) {
        for (HouseProductionTypeEnum v : HouseProductionTypeEnum.values()) {
            if (v.getText().equals(text)) {
                return v.getValue();
            }
        }
        return 0;
    }
 
}