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"; }