提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* 服务类型 |
|
5 |
* |
|
6 |
* @author : 47040 |
|
7 |
* @since : Created in 2020/8/13 10:22 |
|
8 |
*/ |
|
9 |
public enum EM_VIDEOINPUTS_SERVICE_TYPE { |
|
10 |
|
|
11 |
/** |
|
12 |
* 自动 |
|
13 |
*/ |
|
14 |
EM_VIDEOINPUTS_SERVICE_TYPE_AUTO(0, "自动"), |
|
15 |
/** |
|
16 |
* TCP |
|
17 |
*/ |
|
18 |
EM_VIDEOINPUTS_SERVICE_TYPE_TCP(1, "TCP"), |
|
19 |
/** |
|
20 |
* UDP |
|
21 |
*/ |
|
22 |
EM_VIDEOINPUTS_SERVICE_TYPE_UDP(2, "UDP"), |
|
23 |
/** |
|
24 |
* 组播 |
|
25 |
*/ |
|
26 |
EM_VIDEOINPUTS_SERVICE_TYPE_MULTICAST(3, "组播"); |
|
27 |
|
|
28 |
private int value; |
|
29 |
private String note; |
|
30 |
|
|
31 |
private EM_VIDEOINPUTS_SERVICE_TYPE(int givenValue, String note) { |
|
32 |
this.value = givenValue; |
|
33 |
this.note = note; |
|
34 |
} |
|
35 |
|
|
36 |
public String getNote() { |
|
37 |
return note; |
|
38 |
} |
|
39 |
|
|
40 |
public int getValue() { |
|
41 |
return value; |
|
42 |
} |
|
43 |
|
|
44 |
public static String getNoteByValue(int givenValue) { |
|
45 |
for (EM_VIDEOINPUTS_SERVICE_TYPE enumType : EM_VIDEOINPUTS_SERVICE_TYPE.values()) { |
|
46 |
if (givenValue == enumType.getValue()) { |
|
47 |
return enumType.getNote(); |
|
48 |
} |
|
49 |
} |
|
50 |
return null; |
|
51 |
} |
|
52 |
|
|
53 |
public static int getValueByNote(String givenNote) { |
|
54 |
for (EM_VIDEOINPUTS_SERVICE_TYPE enumType : EM_VIDEOINPUTS_SERVICE_TYPE.values()) { |
|
55 |
if (givenNote.equals(enumType.getNote())) { |
|
56 |
return enumType.getValue(); |
|
57 |
} |
|
58 |
} |
|
59 |
return -1; |
|
60 |
} |
|
61 |
|
|
62 |
} |