提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* 输入媒体介质 |
|
5 |
* |
|
6 |
* @author : 47040 |
|
7 |
* @since : Created in 2020/9/28 16:05 |
|
8 |
*/ |
|
9 |
public enum NET_ENUM_INPUT_CHANNEL_MEDIA { |
|
10 |
/** |
|
11 |
* 未知 |
|
12 |
*/ |
|
13 |
NET_ENUM_INPUT_MEDIA_UNKNOWN(0, "未知"), |
|
14 |
/** |
|
15 |
* VGA |
|
16 |
*/ |
|
17 |
NET_ENUM_INPUT_MEDIA_VGA(1, "VGA"), |
|
18 |
/** |
|
19 |
* HDMI |
|
20 |
*/ |
|
21 |
NET_ENUM_INPUT_MEDIA_HDMI(2, "HDMI"); |
|
22 |
|
|
23 |
private int value; |
|
24 |
private String note; |
|
25 |
|
|
26 |
NET_ENUM_INPUT_CHANNEL_MEDIA(int givenValue, String note) { |
|
27 |
this.value = givenValue; |
|
28 |
this.note = note; |
|
29 |
} |
|
30 |
|
|
31 |
public String getNote() { |
|
32 |
return note; |
|
33 |
} |
|
34 |
|
|
35 |
public int getValue() { |
|
36 |
return value; |
|
37 |
} |
|
38 |
|
|
39 |
public static String getNoteByValue(int givenValue) { |
|
40 |
for (NET_ENUM_INPUT_CHANNEL_MEDIA enumType : NET_ENUM_INPUT_CHANNEL_MEDIA.values()) { |
|
41 |
if (givenValue == enumType.getValue()) { |
|
42 |
return enumType.getNote(); |
|
43 |
} |
|
44 |
} |
|
45 |
return null; |
|
46 |
} |
|
47 |
|
|
48 |
public static int getValueByNote(String givenNote) { |
|
49 |
for (NET_ENUM_INPUT_CHANNEL_MEDIA enumType : NET_ENUM_INPUT_CHANNEL_MEDIA.values()) { |
|
50 |
if (givenNote.equals(enumType.getNote())) { |
|
51 |
return enumType.getValue(); |
|
52 |
} |
|
53 |
} |
|
54 |
return -1; |
|
55 |
} |
|
56 |
|
|
57 |
public static NET_ENUM_INPUT_CHANNEL_MEDIA getEnum(int value) { |
|
58 |
for (NET_ENUM_INPUT_CHANNEL_MEDIA e : NET_ENUM_INPUT_CHANNEL_MEDIA.values()) { |
|
59 |
if (e.getValue() == value) |
|
60 |
return e; |
|
61 |
} |
|
62 |
return NET_ENUM_INPUT_CHANNEL_MEDIA.NET_ENUM_INPUT_MEDIA_UNKNOWN; |
|
63 |
} |
|
64 |
} |