提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* 文件后缀类型 |
|
5 |
* |
|
6 |
* @author 47040 |
|
7 |
* @since Created at 2021/5/31 14:34 |
|
8 |
*/ |
|
9 |
public enum EM_MOBILE_ENFORCE_FILE_TYPE { |
|
10 |
|
|
11 |
EM_MOBILE_ENFORCE_FILE_TYPE_UNKNOWN(0, "未知"), |
|
12 |
EM_MOBILE_ENFORCE_FILE_TYPE_DAV(1, "dav"), |
|
13 |
EM_MOBILE_ENFORCE_FILE_TYPE_MP4(2, "mp4"), |
|
14 |
EM_MOBILE_ENFORCE_FILE_TYPE_AAC(3, "aac"), |
|
15 |
EM_MOBILE_ENFORCE_FILE_TYPE_MP3(4, "mp3"), |
|
16 |
EM_MOBILE_ENFORCE_FILE_TYPE_JPG(5, "jpg"); |
|
17 |
|
|
18 |
private final int value; |
|
19 |
private final String note; |
|
20 |
|
|
21 |
EM_MOBILE_ENFORCE_FILE_TYPE(int givenValue, String note) { |
|
22 |
this.value = givenValue; |
|
23 |
this.note = note; |
|
24 |
} |
|
25 |
|
|
26 |
public String getNote() { |
|
27 |
return note; |
|
28 |
} |
|
29 |
|
|
30 |
public int getValue() { |
|
31 |
return value; |
|
32 |
} |
|
33 |
|
|
34 |
public static String getNoteByValue(int givenValue) { |
|
35 |
for (EM_MOBILE_ENFORCE_FILE_TYPE enumType : EM_MOBILE_ENFORCE_FILE_TYPE.values()) { |
|
36 |
if (givenValue == enumType.getValue()) { |
|
37 |
return enumType.getNote(); |
|
38 |
} |
|
39 |
} |
|
40 |
return null; |
|
41 |
} |
|
42 |
|
|
43 |
public static int getValueByNote(String givenNote) { |
|
44 |
for (EM_MOBILE_ENFORCE_FILE_TYPE enumType : EM_MOBILE_ENFORCE_FILE_TYPE.values()) { |
|
45 |
if (givenNote.equals(enumType.getNote())) { |
|
46 |
return enumType.getValue(); |
|
47 |
} |
|
48 |
} |
|
49 |
return -1; |
|
50 |
} |
|
51 |
|
|
52 |
public static EM_MOBILE_ENFORCE_FILE_TYPE getEnum(int value) { |
|
53 |
for (EM_MOBILE_ENFORCE_FILE_TYPE e : EM_MOBILE_ENFORCE_FILE_TYPE.values()) { |
|
54 |
if (e.getValue() == value) |
|
55 |
return e; |
|
56 |
} |
|
57 |
return EM_MOBILE_ENFORCE_FILE_TYPE.EM_MOBILE_ENFORCE_FILE_TYPE_UNKNOWN; |
|
58 |
} |
|
59 |
|
|
60 |
} |