package com.netsdk.lib.enumeration;
|
|
public enum EM_BACKUP_TARGET_TYPE {
|
EM_TARGET_TYPE_LOCAL(0,"Local"), // "Local", /*本地源*/
|
EM_TARGET_TYPE_NETWORK(1,"Network"); // "Network", /*网络源*/
|
private int value;
|
private String note;
|
|
private EM_BACKUP_TARGET_TYPE(int givenValue, String note) {
|
this.value = givenValue;
|
this.note = note;
|
}
|
|
public String getNote() {
|
return note;
|
}
|
|
public int getValue() {
|
return value;
|
}
|
|
public static String getNoteByValue(int givenValue) {
|
for (EM_TRAFFICSTROBE_STATUS enumType : EM_TRAFFICSTROBE_STATUS.values()) {
|
if (givenValue == enumType.getValue()) {
|
return enumType.getNote();
|
}
|
}
|
return null;
|
}
|
|
public static int getValueByNote(String givenNote) {
|
for (EM_TRAFFICSTROBE_STATUS enumType : EM_TRAFFICSTROBE_STATUS.values()) {
|
if (givenNote.equals(enumType.getNote())) {
|
return enumType.getValue();
|
}
|
}
|
return -1;
|
}
|
}
|