P15GEN2\59518
2024-05-29 d4210c7c4b04abde20037ea8aa0f54ef8a2649aa
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
51
52
53
54
55
56
57
58
59
60
package policy.rule;
 
import java.math.BigDecimal;
 
import foundation.data.entity.Entity;
 
public class RuleMeta {
 
    private String id;
    private String name;
    private String title;
    private BigDecimal value;
    private String unit;
    private String className;
    private CheckLevel level;
    
    
    public void load(Entity entity) {
        id = entity.getString("id");
        name = entity.getString("name");
        title = entity.getString("title");
        value = entity.getBigDecimal("value", BigDecimal.ZERO);
        unit = entity.getString("unit");
        className = entity.getString("class_name");
        level = CheckLevel.parse(entity.getString("level"));
    }
    
    public String getId() {
        return id;
    }
 
    public String getName() {
        return name;
    }
 
    public BigDecimal getValue() {
        return value;
    }
 
    public BigDecimal getRateValue() {
        return value.divide(new BigDecimal(100), BigDecimal.ROUND_HALF_UP);
    }
 
    public String getClassName() {
        return className;
    }
 
    public String getTitle() {
        return title;
    }
 
    public CheckLevel getLevel() {
        return level;
    }
 
    public String getUnit() {
        return unit;
    }
 
}