WangHan
2024-09-12 d5855a4926926698b740bc6c7ba489de47adb68b
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
package tech.powerjob.common.enums;
 
import lombok.AllArgsConstructor;
import lombok.Getter;
 
/**
 * Execution type.
 *
 * @author tjq
 * @since 2020/3/17
 */
@Getter
@AllArgsConstructor
public enum ExecuteType {
    /**
     * Standalone type of task.
     */
    STANDALONE(1, "单机执行"),
    /**
     * Broadcast type of task.
     */
    BROADCAST(2, "广播执行"),
    /**
     * MapReduce type of task.
     */
    MAP_REDUCE(3, "MapReduce"),
    MAP(4, "Map");
 
    private final int v;
    private final String des;
 
    public static ExecuteType of(int v) {
        for (ExecuteType type : values()) {
            if (type.v == v) {
                return type;
            }
        }
        throw new IllegalArgumentException("unknown ExecuteType of " + v);
    }
}