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
| package com.zy.core.enums;
|
| import com.core.common.Cools;
|
| public enum CyclePlanStatus {
|
| NEW(0, "新建"),
| RUNNING(1, "运行中"),
| PAUSED(2, "暂停"),
| COMPLETED(3, "已完成"),
| CANCELLED(4, "已取消"),
| ;
|
| CyclePlanStatus(int id, String desc) {
| this.id = id;
| this.desc = desc;
| }
|
| public int id;
| public String desc;
|
| public static CyclePlanStatus get(int id) {
| if (Cools.isEmpty(id)) {
| return null;
| }
| for (CyclePlanStatus value : CyclePlanStatus.values()) {
| if (value.id == id) {
| return value;
| }
| }
| return null;
| }
|
| public static CyclePlanStatus get(String desc) {
| if (Cools.isEmpty(desc)) {
| return null;
| }
| for (CyclePlanStatus value : CyclePlanStatus.values()) {
| if (value.desc.equals(desc)) {
| return value;
| }
| }
| return null;
| }
|
| }
|
|