yangys
2024-09-04 04c57331cf84c8f606c2838dcb6fe5463fb9b68c
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
package com.qianwen.smartman.modules.mdc.enums;
 
public enum ProcessParamEnum {
    SHIFT(1, "班次"),
    HOUR(2, "小时");
    
    private final Integer code;
    private final String mode;
 
    ProcessParamEnum(final Integer code, final String mode) {
        this.code = code;
        this.mode = mode;
    }
 
    public Integer getCode() {
        return this.code;
    }
 
    public String getMode() {
        return this.mode;
    }
 
    public static ProcessParamEnum of(Integer code) {
        if (code == null) {
            return SHIFT;
        }
        ProcessParamEnum[] values = values();
        for (ProcessParamEnum methodEnum : values) {
            if (methodEnum.code.equals(code)) {
                return methodEnum;
            }
        }
        return SHIFT;
    }
}