• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 package ohos.devtools.datasources.utils.device.entity;
17 
18 import ohos.devtools.views.common.LayoutConstants;
19 
20 import java.io.Serializable;
21 import java.util.Objects;
22 
23 /**
24  * Device IP and port number information
25  *
26  * @since 2021/5/19 16:39
27  */
28 public class DeviceIPPortInfo implements Serializable {
29     private static final long serialVersionUID = -290179609047525076L;
30 
31     private String deviceID;
32     private String deviceName;
33     private String ip;
34     private int port;
35     private DeviceType deviceType;
36     private String connectType = LayoutConstants.USB;
37     private int forwardPort;
38     private int deviceStatus;
39     private int retryNum;
40     private int offlineCount;
41 
getDeviceType()42     public DeviceType getDeviceType() {
43         return deviceType;
44     }
45 
setDeviceType(DeviceType deviceType)46     public void setDeviceType(DeviceType deviceType) {
47         this.deviceType = deviceType;
48     }
49 
getDeviceName()50     public String getDeviceName() {
51         return deviceName;
52     }
53 
setDeviceName(String deviceName)54     public void setDeviceName(String deviceName) {
55         this.deviceName = deviceName;
56     }
57 
getDeviceID()58     public String getDeviceID() {
59         return deviceID;
60     }
61 
setDeviceID(String deviceID)62     public void setDeviceID(String deviceID) {
63         this.deviceID = deviceID;
64     }
65 
getIp()66     public String getIp() {
67         return ip;
68     }
69 
setIp(String ip)70     public void setIp(String ip) {
71         this.ip = ip;
72     }
73 
getPort()74     public int getPort() {
75         return port;
76     }
77 
setPort(int port)78     public void setPort(int port) {
79         this.port = port;
80     }
81 
getForwardPort()82     public int getForwardPort() {
83         return forwardPort;
84     }
85 
setForwardPort(int forwardPort)86     public void setForwardPort(int forwardPort) {
87         this.forwardPort = forwardPort;
88     }
89 
getConnectType()90     public String getConnectType() {
91         return connectType;
92     }
93 
setConnectType(String connectType)94     public void setConnectType(String connectType) {
95         this.connectType = connectType;
96     }
97 
getDeviceStatus()98     public int getDeviceStatus() {
99         return deviceStatus;
100     }
101 
setDeviceStatus(int deviceStatus)102     public void setDeviceStatus(int deviceStatus) {
103         this.deviceStatus = deviceStatus;
104     }
105 
getRetryNum()106     public int getRetryNum() {
107         return retryNum;
108     }
109 
setRetryNum(int retryNum)110     public void setRetryNum(int retryNum) {
111         this.retryNum = retryNum;
112     }
113 
getOfflineCount()114     public int getOfflineCount() {
115         return offlineCount;
116     }
117 
setOfflineCount(int offlineCount)118     public void setOfflineCount(int offlineCount) {
119         this.offlineCount = offlineCount;
120     }
121 
122     @Override
equals(Object obj)123     public boolean equals(Object obj) {
124         return super.equals(obj);
125     }
126 
127     @Override
clone()128     protected Object clone() throws CloneNotSupportedException {
129         return super.clone();
130     }
131 
132     @Override
hashCode()133     public int hashCode() {
134         return Objects
135             .hash(deviceID, deviceName, ip, port, deviceType, connectType, forwardPort, deviceStatus, retryNum);
136     }
137 
138     @Override
toString()139     public String toString() {
140         return deviceName;
141     }
142 }
143