提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
public enum EM_BACKUP_TARGET_TYPE { |
|
4 |
EM_TARGET_TYPE_LOCAL(0,"Local"), // "Local", /*本地源*/ |
|
5 |
EM_TARGET_TYPE_NETWORK(1,"Network"); // "Network", /*网络源*/ |
|
6 |
private int value; |
|
7 |
private String note; |
|
8 |
|
|
9 |
private EM_BACKUP_TARGET_TYPE(int givenValue, String note) { |
|
10 |
this.value = givenValue; |
|
11 |
this.note = note; |
|
12 |
} |
|
13 |
|
|
14 |
public String getNote() { |
|
15 |
return note; |
|
16 |
} |
|
17 |
|
|
18 |
public int getValue() { |
|
19 |
return value; |
|
20 |
} |
|
21 |
|
|
22 |
public static String getNoteByValue(int givenValue) { |
|
23 |
for (EM_TRAFFICSTROBE_STATUS enumType : EM_TRAFFICSTROBE_STATUS.values()) { |
|
24 |
if (givenValue == enumType.getValue()) { |
|
25 |
return enumType.getNote(); |
|
26 |
} |
|
27 |
} |
|
28 |
return null; |
|
29 |
} |
|
30 |
|
|
31 |
public static int getValueByNote(String givenNote) { |
|
32 |
for (EM_TRAFFICSTROBE_STATUS enumType : EM_TRAFFICSTROBE_STATUS.values()) { |
|
33 |
if (givenNote.equals(enumType.getNote())) { |
|
34 |
return enumType.getValue(); |
|
35 |
} |
|
36 |
} |
|
37 |
return -1; |
|
38 |
} |
|
39 |
} |