提交 | 用户 | 时间
|
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 MisfireStrategyEnum { |
|
9 |
|
|
10 |
/** |
|
11 |
* do nothing |
|
12 |
*/ |
|
13 |
DO_NOTHING(I18nUtil.getString("misfire_strategy_do_nothing")), |
|
14 |
|
|
15 |
/** |
|
16 |
* fire once now |
|
17 |
*/ |
|
18 |
FIRE_ONCE_NOW(I18nUtil.getString("misfire_strategy_fire_once_now")); |
|
19 |
|
|
20 |
private String title; |
|
21 |
|
|
22 |
MisfireStrategyEnum(String title) { |
|
23 |
this.title = title; |
|
24 |
} |
|
25 |
|
|
26 |
public String getTitle() { |
|
27 |
return title; |
|
28 |
} |
|
29 |
|
|
30 |
public static MisfireStrategyEnum match(String name, MisfireStrategyEnum defaultItem){ |
|
31 |
for (MisfireStrategyEnum item: MisfireStrategyEnum.values()) { |
|
32 |
if (item.name().equals(name)) { |
|
33 |
return item; |
|
34 |
} |
|
35 |
} |
|
36 |
return defaultItem; |
|
37 |
} |
|
38 |
|
|
39 |
} |