Powerjob-server 服务管理端 4.3.6 版本
zrj
2024-09-24 1216a77e26cb2c788fa6a78991e073e671f0f59d
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
package tech.powerjob.server.common.constants;
 
import lombok.AllArgsConstructor;
import lombok.Getter;
 
/**
 * 支持开/关的状态,如 任务状态(JobStatus)和工作流状态(WorkflowStatus)
 *
 * @author tjq
 * @since 2020/4/6
 */
@Getter
@AllArgsConstructor
public enum SwitchableStatus {
    /**
     *
     */
    ENABLE(1),
    DISABLE(2),
    DELETED(99);
 
    private final int v;
 
    public static SwitchableStatus of(int v) {
        for (SwitchableStatus type : values()) {
            if (type.v == v) {
                return type;
            }
        }
        throw new IllegalArgumentException("unknown SwitchableStatus of " + v);
    }
}