dongyukun
2024-11-05 e8ad669f7c97d45cd23630dc101180a130d6c17e
提交 | 用户 | 时间
ce910c 1 package com.netsdk.lib.enumeration;
H 2
3 /**
4  * @author 251823
5  * @description 失败的原因
6  * @date 2021/11/07
7  */
8 public enum EM_RECORD_BACKUP_FAIL_REASON {
9     /**
10      未知
11      */
12     EM_RECORD_BACKUP_FAIL_REASON_UNKNOW(0,"未知"),
13     /**
14      登入失败
15      */
16     EM_RECORD_BACKUP_FAIL_REASON_LOGIN_FAIL(1,"登入失败"),
17     /**
18      没有查询到录像
19      */
20     EM_RECORD_BACKUP_FAIL_REASON_NO_FILES(2,"没有查询到录像"),
21     /**
22      下载过程中网络断开
23      */
24     EM_RECORD_BACKUP_FAIL_REASON_DOWNLOAD_NET_ERROR(3,"下载过程中网络断开"),
25     /**
26      未知错误
27      */
28     EM_RECORD_BACKUP_FAIL_REASON_UNKNOW_ERROR(4,"未知错误"),
29     /**
30      用户名无效
31      */
32     EM_RECORD_BACKUP_FAIL_REASON_USER_NAME_NOT_VALID(5,"用户名无效"),
33     /**
34      密码错误
35      */
36     EM_RECORD_BACKUP_FAIL_REASON_PASSWORD_NOT_VALID(6,"密码错误"),
37     /**
38      地址被屏蔽
39      */
40     EM_RECORD_BACKUP_FAIL_REASON_PEER_HAS_BEEN_BLOCKED(7,"地址被屏蔽"),
41     /**
42      地址在禁止访问名单内
43      */
44     EM_RECORD_BACKUP_FAIL_REASON_PEER_IN_BLOCK_LIST(8,"地址在禁止访问名单内"),
45     /**
46      超出最大连接数
47      */
48     EM_RECORD_BACKUP_FAIL_REASON_TOO_MANY_CONNECTIONS(9,"超出最大连接数"),
49     /**
50      账号被锁定
51      */
52     EM_RECORD_BACKUP_FAIL_REASON_ACCOUNT_HAS_BEEN_BLOCKED(10,"账号被锁定"),
53     /**
54      登入时网络连接失败
55      */
56     EM_RECORD_BACKUP_FAIL_REASON_LOGIN_CONNECT_FAILED(11,"登入时网络连接失败"),
57     /**
58      登入用户名或者密码错误
59      */
60     EM_RECORD_BACKUP_FAIL_REASON_USER_OR_PWD_NOT_VALID(12,"登入用户名或者密码错误"),
61     /**
62      登入超时
63      */
64     EM_RECORD_BACKUP_FAIL_REASON_LOGIN_CONNECT_TIMEOUT(13,"登入超时");
65
66     private int value;
67     private String note;
68
69     private EM_RECORD_BACKUP_FAIL_REASON(int givenValue, String note) {
70         this.value = givenValue;
71         this.note = note;
72     }
73
74     public String getNote() {
75         return note;
76     }
77
78     public int getValue() {
79         return value;
80     }
81
82     public static String getNoteByValue(int givenValue) {
83         for (EM_RECORD_BACKUP_FAIL_REASON enumType : EM_RECORD_BACKUP_FAIL_REASON.values()) {
84             if (givenValue == enumType.getValue()) {
85                 return enumType.getNote();
86             }
87         }
88         return null;
89     }
90
91     public static int getValueByNote(String givenNote) {
92         for (EM_RECORD_BACKUP_FAIL_REASON enumType : EM_RECORD_BACKUP_FAIL_REASON.values()) {
93             if (givenNote.equals(enumType.getNote())) {
94                 return enumType.getValue();
95             }
96         }
97         return -1;
98     }
99 }