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