提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* 文件上传标志 |
|
5 |
* |
|
6 |
* @author 47040 |
|
7 |
* @since Created at 2021/5/31 10:16 |
|
8 |
*/ |
|
9 |
public enum EM_MOBILE_ENFORCE_UPLOAD_FLAG { |
|
10 |
|
|
11 |
EM_MOBILE_ENFORCE_UPLOAD_FLAG_UNKNWON(-1, "未知"), |
|
12 |
EM_MOBILE_ENFORCE_UPLOAD_FLAG_NOTUPLOAD(0, "未上传"), |
|
13 |
EM_MOBILE_ENFORCE_UPLOAD_FLAG_UPLOADED(1, "已上传"), |
|
14 |
EM_MOBILE_ENFORCE_UPLOAD_FLAG_BACKEDUP(3, "已备份"); |
|
15 |
|
|
16 |
private final int value; |
|
17 |
private final String note; |
|
18 |
|
|
19 |
EM_MOBILE_ENFORCE_UPLOAD_FLAG(int givenValue, String note) { |
|
20 |
this.value = givenValue; |
|
21 |
this.note = note; |
|
22 |
} |
|
23 |
|
|
24 |
public String getNote() { |
|
25 |
return note; |
|
26 |
} |
|
27 |
|
|
28 |
public int getValue() { |
|
29 |
return value; |
|
30 |
} |
|
31 |
|
|
32 |
public static String getNoteByValue(int givenValue) { |
|
33 |
for (EM_MOBILE_ENFORCE_UPLOAD_FLAG enumType : EM_MOBILE_ENFORCE_UPLOAD_FLAG.values()) { |
|
34 |
if (givenValue == enumType.getValue()) { |
|
35 |
return enumType.getNote(); |
|
36 |
} |
|
37 |
} |
|
38 |
return null; |
|
39 |
} |
|
40 |
|
|
41 |
public static int getValueByNote(String givenNote) { |
|
42 |
for (EM_MOBILE_ENFORCE_UPLOAD_FLAG enumType : EM_MOBILE_ENFORCE_UPLOAD_FLAG.values()) { |
|
43 |
if (givenNote.equals(enumType.getNote())) { |
|
44 |
return enumType.getValue(); |
|
45 |
} |
|
46 |
} |
|
47 |
return -1; |
|
48 |
} |
|
49 |
|
|
50 |
public static EM_MOBILE_ENFORCE_UPLOAD_FLAG getEnum(int value) { |
|
51 |
for (EM_MOBILE_ENFORCE_UPLOAD_FLAG e : EM_MOBILE_ENFORCE_UPLOAD_FLAG.values()) { |
|
52 |
if (e.getValue() == value) |
|
53 |
return e; |
|
54 |
} |
|
55 |
return EM_MOBILE_ENFORCE_UPLOAD_FLAG.EM_MOBILE_ENFORCE_UPLOAD_FLAG_UNKNWON; |
|
56 |
} |
|
57 |
} |