]> git.basschouten.com Git - openhab-addons.git/blob
6ce23c421314b76e9e67c181b054f5dd4073dec8
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13
14 package org.openhab.binding.speedtest.internal.dto;
15
16 import com.google.gson.annotations.Expose;
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * The {@link ResultContainer} class defines a container for Speedtest results.
21  *
22  * @author Brian Homeyer - Initial contribution
23  */
24 public class ResultContainer {
25
26     @SerializedName("type")
27     @Expose
28     private String type;
29     @SerializedName("timestamp")
30     @Expose
31     private String timestamp;
32     @SerializedName("ping")
33     @Expose
34     private Ping ping;
35     @SerializedName("download")
36     @Expose
37     private Download download;
38     @SerializedName("upload")
39     @Expose
40     private Upload upload;
41     @SerializedName("packetLoss")
42     @Expose
43     private Double packetLoss;
44     @SerializedName("isp")
45     @Expose
46     private String isp;
47     @SerializedName("interface")
48     @Expose
49     private Interface networkInterface;
50     @SerializedName("server")
51     @Expose
52     private Server server;
53     @SerializedName("result")
54     @Expose
55     private Result result;
56
57     public String getType() {
58         return type;
59     }
60
61     public void setType(String type) {
62         this.type = type;
63     }
64
65     public String getTimestamp() {
66         return timestamp;
67     }
68
69     public void setTimestamp(String timestamp) {
70         this.timestamp = timestamp;
71     }
72
73     public Ping getPing() {
74         return ping;
75     }
76
77     public void setPing(Ping ping) {
78         this.ping = ping;
79     }
80
81     public Download getDownload() {
82         return download;
83     }
84
85     public void setDownload(Download download) {
86         this.download = download;
87     }
88
89     public Upload getUpload() {
90         return upload;
91     }
92
93     public void setUpload(Upload upload) {
94         this.upload = upload;
95     }
96
97     public Double getPacketLoss() {
98         return packetLoss;
99     }
100
101     public void setPacketLoss(Double packetLoss) {
102         this.packetLoss = packetLoss;
103     }
104
105     public String getIsp() {
106         return isp;
107     }
108
109     public void setIsp(String isp) {
110         this.isp = isp;
111     }
112
113     public Interface getInterface() {
114         return networkInterface;
115     }
116
117     public void setInterface(Interface networkInterface) {
118         this.networkInterface = networkInterface;
119     }
120
121     public Server getServer() {
122         return server;
123     }
124
125     public void setServer(Server server) {
126         this.server = server;
127     }
128
129     public Result getResult() {
130         return result;
131     }
132
133     public void setResult(Result result) {
134         this.result = result;
135     }
136
137     public class Download {
138
139         @SerializedName("bandwidth")
140         @Expose
141         private String bandwidth;
142         @SerializedName("bytes")
143         @Expose
144         private String bytes;
145         @SerializedName("elapsed")
146         @Expose
147         private String elapsed;
148
149         public String getBandwidth() {
150             return bandwidth;
151         }
152
153         public void setBandwidth(String bandwidth) {
154             this.bandwidth = bandwidth;
155         }
156
157         public String getBytes() {
158             return bytes;
159         }
160
161         public void setBytes(String bytes) {
162             this.bytes = bytes;
163         }
164
165         public String getElapsed() {
166             return elapsed;
167         }
168
169         public void setElapsed(String elapsed) {
170             this.elapsed = elapsed;
171         }
172     }
173
174     public class Interface {
175
176         @SerializedName("internalIp")
177         @Expose
178         private String internalIp;
179         @SerializedName("name")
180         @Expose
181         private String name;
182         @SerializedName("macAddr")
183         @Expose
184         private String macAddr;
185         @SerializedName("isVpn")
186         @Expose
187         private Boolean isVpn;
188         @SerializedName("externalIp")
189         @Expose
190         private String externalIp;
191
192         public String getInternalIp() {
193             return internalIp;
194         }
195
196         public void setInternalIp(String internalIp) {
197             this.internalIp = internalIp;
198         }
199
200         public String getName() {
201             return name;
202         }
203
204         public void setName(String name) {
205             this.name = name;
206         }
207
208         public String getMacAddr() {
209             return macAddr;
210         }
211
212         public void setMacAddr(String macAddr) {
213             this.macAddr = macAddr;
214         }
215
216         public Boolean getIsVpn() {
217             return isVpn;
218         }
219
220         public void setIsVpn(Boolean isVpn) {
221             this.isVpn = isVpn;
222         }
223
224         public String getExternalIp() {
225             return externalIp;
226         }
227
228         public void setExternalIp(String externalIp) {
229             this.externalIp = externalIp;
230         }
231     }
232
233     public class Ping {
234
235         @SerializedName("jitter")
236         @Expose
237         private String jitter;
238         @SerializedName("latency")
239         @Expose
240         private String latency;
241
242         public String getJitter() {
243             return jitter;
244         }
245
246         public void setJitter(String jitter) {
247             this.jitter = jitter;
248         }
249
250         public String getLatency() {
251             return latency;
252         }
253
254         public void setLatency(String latency) {
255             this.latency = latency;
256         }
257     }
258
259     public class Result {
260
261         @SerializedName("id")
262         @Expose
263         private String id;
264         @SerializedName("url")
265         @Expose
266         private String url;
267
268         public String getId() {
269             return id;
270         }
271
272         public void setId(String id) {
273             this.id = id;
274         }
275
276         public String getUrl() {
277             return url;
278         }
279
280         public void setUrl(String url) {
281             this.url = url;
282         }
283     }
284
285     public class Server {
286
287         @SerializedName("id")
288         @Expose
289         private Integer id;
290         @SerializedName("name")
291         @Expose
292         private String name;
293         @SerializedName("location")
294         @Expose
295         private String location;
296         @SerializedName("country")
297         @Expose
298         private String country;
299         @SerializedName("host")
300         @Expose
301         private String host;
302         @SerializedName("port")
303         @Expose
304         private Integer port;
305         @SerializedName("ip")
306         @Expose
307         private String ip;
308
309         public Integer getId() {
310             return id;
311         }
312
313         public void setId(Integer id) {
314             this.id = id;
315         }
316
317         public String getName() {
318             return name;
319         }
320
321         public void setName(String name) {
322             this.name = name;
323         }
324
325         public String getLocation() {
326             return location;
327         }
328
329         public void setLocation(String location) {
330             this.location = location;
331         }
332
333         public String getCountry() {
334             return country;
335         }
336
337         public void setCountry(String country) {
338             this.country = country;
339         }
340
341         public String getHost() {
342             return host;
343         }
344
345         public void setHost(String host) {
346             this.host = host;
347         }
348
349         public Integer getPort() {
350             return port;
351         }
352
353         public void setPort(Integer port) {
354             this.port = port;
355         }
356
357         public String getIp() {
358             return ip;
359         }
360
361         public void setIp(String ip) {
362             this.ip = ip;
363         }
364     }
365
366     public class Upload {
367
368         @SerializedName("bandwidth")
369         @Expose
370         private String bandwidth;
371         @SerializedName("bytes")
372         @Expose
373         private String bytes;
374         @SerializedName("elapsed")
375         @Expose
376         private String elapsed;
377
378         public String getBandwidth() {
379             return bandwidth;
380         }
381
382         public void setBandwidth(String bandwidth) {
383             this.bandwidth = bandwidth;
384         }
385
386         public String getBytes() {
387             return bytes;
388         }
389
390         public void setBytes(String bytes) {
391             this.bytes = bytes;
392         }
393
394         public String getElapsed() {
395             return elapsed;
396         }
397
398         public void setElapsed(String elapsed) {
399             this.elapsed = elapsed;
400         }
401     }
402 }