提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 工装建模错误码 |
|
6 |
* @date 2022/10/09 11:22:52 |
|
7 |
*/ |
|
8 |
public enum EM_WORKSUIT_ABSTRACT_ERRCODE { |
|
9 |
/** |
|
10 |
* 未知 |
|
11 |
*/ |
|
12 |
EM_WORKSUIT_ABSTRACT_ERRCODE_UNKNWON(0, "未知"), |
|
13 |
/** |
|
14 |
* 建模失败 |
|
15 |
*/ |
|
16 |
EM_WORKSUIT_ABSTRACT_ERRCODE_FAILED(1, "建模失败"), |
|
17 |
/** |
|
18 |
* 系统异常(如Licence失效、建模分析器未启动导致的失败) |
|
19 |
*/ |
|
20 |
EM_WORKSUIT_ABSTRACT_ERRCODE_SYSERR(2, "系统异常(如Licence失效、建模分析器未启动导致的失败)"), |
|
21 |
/** |
|
22 |
* 数据库操作失败 |
|
23 |
*/ |
|
24 |
EM_WORKSUIT_ABSTRACT_ERRCODE_DB_ERROR(3, "数据库操作失败"), |
|
25 |
/** |
|
26 |
* 工装数量超过限制 |
|
27 |
*/ |
|
28 |
EM_WORKSUIT_ABSTRACT_ERRCODE_OVER_NUM(4, "工装数量超过限制"), |
|
29 |
/** |
|
30 |
* 剩余存储空间大小不足 |
|
31 |
*/ |
|
32 |
EM_WORKSUIT_ABSTRACT_ERRCODE_NO_STORAGE(5, "剩余存储空间大小不足"); |
|
33 |
|
|
34 |
private int value; |
|
35 |
|
|
36 |
private String note; |
|
37 |
|
|
38 |
public String getNote() { |
|
39 |
return note; |
|
40 |
} |
|
41 |
|
|
42 |
public int getValue() { |
|
43 |
return value; |
|
44 |
} |
|
45 |
|
|
46 |
EM_WORKSUIT_ABSTRACT_ERRCODE(int givenValue, String note) { |
|
47 |
this.value = givenValue; |
|
48 |
this.note = note; |
|
49 |
} |
|
50 |
|
|
51 |
public static String getNoteByValue(int givenValue) { |
|
52 |
for (EM_WORKSUIT_ABSTRACT_ERRCODE enumType : EM_WORKSUIT_ABSTRACT_ERRCODE.values()) { |
|
53 |
if (givenValue == enumType.getValue()) { |
|
54 |
return enumType.getNote(); |
|
55 |
} |
|
56 |
} |
|
57 |
return null; |
|
58 |
} |
|
59 |
|
|
60 |
public static int getValueByNote(String givenNote) { |
|
61 |
for (EM_WORKSUIT_ABSTRACT_ERRCODE enumType : EM_WORKSUIT_ABSTRACT_ERRCODE.values()) { |
|
62 |
if (givenNote.equals(enumType.getNote())) { |
|
63 |
return enumType.getValue(); |
|
64 |
} |
|
65 |
} |
|
66 |
return -1; |
|
67 |
} |
|
68 |
|
|
69 |
} |