提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
|
|
4 |
/** |
|
5 |
* @author 291189 |
|
6 |
* @description 智能分析任务错误码 |
|
7 |
* @date 2022/12/01 20:05:32 |
|
8 |
*/ |
|
9 |
public enum EM_ANALYSE_TASK_ERROR { |
|
10 |
/** |
|
11 |
未知 |
|
12 |
*/ |
|
13 |
EM_ANALYSE_TASK_ERROR_UNKNOWN(1,"未知"), |
|
14 |
/** |
|
15 |
解码能力不足 |
|
16 |
*/ |
|
17 |
EM_ANALYSE_TASK_ERROR_INSUFFICIENT_DECODING_CAPABILITY(2,"解码能力不足"), |
|
18 |
/** |
|
19 |
智能能力不足 |
|
20 |
*/ |
|
21 |
EM_ANALYSE_TASK_ERROR_INSUFFICIENT_INTELLIGENCE_CAPABILITY(3,"智能能力不足"), |
|
22 |
/** |
|
23 |
码流格式不支持 |
|
24 |
*/ |
|
25 |
EM_ANALYSE_TASK_ERROR_BITSTREAM_FORMAT_NOT_SUPPORTED(4,"码流格式不支持"), |
|
26 |
/** |
|
27 |
分析器离线 |
|
28 |
*/ |
|
29 |
EM_ANALYSE_TASK_ERROR_ANALYZER_OFF_LINE(5,"分析器离线"), |
|
30 |
/** |
|
31 |
分析器上线 |
|
32 |
*/ |
|
33 |
EM_ANALYSE_TASK_ERROR_ANALYZER_ON_LINE(6,"分析器上线"); |
|
34 |
|
|
35 |
private int value; |
|
36 |
|
|
37 |
private String note; |
|
38 |
|
|
39 |
public String getNote() { |
|
40 |
return note; |
|
41 |
} |
|
42 |
|
|
43 |
public int getValue() { |
|
44 |
return value; |
|
45 |
} |
|
46 |
|
|
47 |
EM_ANALYSE_TASK_ERROR(int givenValue, String note) { |
|
48 |
this.value = givenValue; |
|
49 |
this.note = note; |
|
50 |
} |
|
51 |
|
|
52 |
public static String getNoteByValue(int givenValue) { |
|
53 |
for (EM_ANALYSE_TASK_ERROR enumType : EM_ANALYSE_TASK_ERROR.values()) { |
|
54 |
if (givenValue == enumType.getValue()) { |
|
55 |
return enumType.getNote(); |
|
56 |
} |
|
57 |
} |
|
58 |
return null; |
|
59 |
} |
|
60 |
|
|
61 |
public static int getValueByNote(String givenNote) { |
|
62 |
for (EM_ANALYSE_TASK_ERROR enumType : EM_ANALYSE_TASK_ERROR.values()) { |
|
63 |
if (givenNote.equals(enumType.getNote())) { |
|
64 |
return enumType.getValue(); |
|
65 |
} |
|
66 |
} |
|
67 |
return 0; |
|
68 |
} |
|
69 |
|
|
70 |
public static EM_ANALYSE_TASK_ERROR getEnum(int value) { |
|
71 |
for (EM_ANALYSE_TASK_ERROR e : EM_ANALYSE_TASK_ERROR.values()) { |
|
72 |
if (e.getValue() == value) |
|
73 |
return e; |
|
74 |
} |
|
75 |
return EM_ANALYSE_TASK_ERROR.EM_ANALYSE_TASK_ERROR_UNKNOWN; |
|
76 |
} |
|
77 |
|
|
78 |
} |