shikeying
2022-09-23 eb440e88db0f1a2c405a1e256d33df39f091404d
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
package com.iplatform.reccommon;
 
/**
 * 采集任务类型定义。
 */
public enum TaskType {
 
    VideoLoad {
        public String getIndex(){
            return INDEX_VIDEO_LOAD;
        }
    },
    TextLoad {
        public String getIndex(){
            return INDEX_TEXT_LOAD;
        }
    };
 
    public String getIndex(){
        throw new AbstractMethodError();
    }
 
    public static final TaskType getType(String index){
        if(index.equals(INDEX_VIDEO_LOAD)){
            return VideoLoad;
        } else if(index.equals(INDEX_TEXT_LOAD)){
            return TextLoad;
        } else {
            throw new UnsupportedOperationException("index '" + index + "' is not supported!");
        }
    }
 
    public static final String INDEX_VIDEO_LOAD = "video_load";
    public static final String INDEX_TEXT_LOAD = "text_load";
 
}