提交 | 用户 | 时间
|
e7c126
|
1 |
package com.xxl.job.admin.core.scheduler; |
H |
2 |
|
|
3 |
import com.xxl.job.admin.core.util.I18nUtil; |
|
4 |
|
|
5 |
/** |
|
6 |
* @author xuxueli 2020-10-29 21:11:23 |
|
7 |
*/ |
|
8 |
public enum ScheduleTypeEnum { |
|
9 |
|
|
10 |
NONE(I18nUtil.getString("schedule_type_none")), |
|
11 |
|
|
12 |
/** |
|
13 |
* schedule by cron |
|
14 |
*/ |
|
15 |
CRON(I18nUtil.getString("schedule_type_cron")), |
|
16 |
|
|
17 |
/** |
|
18 |
* schedule by fixed rate (in seconds) |
|
19 |
*/ |
|
20 |
FIX_RATE(I18nUtil.getString("schedule_type_fix_rate")), |
|
21 |
|
|
22 |
/** |
|
23 |
* schedule by fix delay (in seconds), after the last time |
|
24 |
*/ |
|
25 |
/*FIX_DELAY(I18nUtil.getString("schedule_type_fix_delay"))*/; |
|
26 |
|
|
27 |
private String title; |
|
28 |
|
|
29 |
ScheduleTypeEnum(String title) { |
|
30 |
this.title = title; |
|
31 |
} |
|
32 |
|
|
33 |
public String getTitle() { |
|
34 |
return title; |
|
35 |
} |
|
36 |
|
|
37 |
public static ScheduleTypeEnum match(String name, ScheduleTypeEnum defaultItem){ |
|
38 |
for (ScheduleTypeEnum item: ScheduleTypeEnum.values()) { |
|
39 |
if (item.name().equals(name)) { |
|
40 |
return item; |
|
41 |
} |
|
42 |
} |
|
43 |
return defaultItem; |
|
44 |
} |
|
45 |
|
|
46 |
} |