shikeyin
2024-01-11 65da8373531677b1c37a98f53eaa30c892f35e5a
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
package com.iplatform.tcp;
 
/**
 * 通讯连接状态枚举类型定义
 * @author 时克英
 * @date 2018-11-29
 *
 */
public enum LiveStatus {
 
    /**
     * 未连接:0
     */
    NotConnect {
        public int getTypeValue(){
            return CONST_NOT_CONNECT;
        }
    },
 
    /**
     * 已连接:1
     */
    Connected {
        public int getTypeValue(){
            return CONST_CONNECTED;
        }
    };
 
    public static final int CONST_CONNECTED = 1;
    public static final int CONST_NOT_CONNECT = 0;
 
    public int getTypeValue(){
        throw new AbstractMethodError();
    }
 
    public static LiveStatus getType(int index){
        if(index == CONST_CONNECTED){
            return Connected;
        } else if(index == CONST_NOT_CONNECT){
            return NotConnect;
        } else
            throw new IllegalArgumentException("unsupported LiveStatus: " + index);
    }
}