2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
14 package org.openhab.binding.speedtest.internal.dto;
16 import com.google.gson.annotations.Expose;
17 import com.google.gson.annotations.SerializedName;
20 * The {@link ResultContainer} class defines a container for Speedtest results.
22 * @author Brian Homeyer - Initial contribution
24 public class ResultContainer {
26 @SerializedName("type")
29 @SerializedName("timestamp")
31 private String timestamp;
32 @SerializedName("ping")
35 @SerializedName("download")
37 private Download download;
38 @SerializedName("upload")
40 private Upload upload;
41 @SerializedName("packetLoss")
43 private Double packetLoss;
44 @SerializedName("isp")
47 @SerializedName("interface")
49 private Interface networkInterface;
50 @SerializedName("server")
52 private Server server;
53 @SerializedName("result")
55 private Result result;
57 public String getType() {
61 public void setType(String type) {
65 public String getTimestamp() {
69 public void setTimestamp(String timestamp) {
70 this.timestamp = timestamp;
73 public Ping getPing() {
77 public void setPing(Ping ping) {
81 public Download getDownload() {
85 public void setDownload(Download download) {
86 this.download = download;
89 public Upload getUpload() {
93 public void setUpload(Upload upload) {
97 public Double getPacketLoss() {
101 public void setPacketLoss(Double packetLoss) {
102 this.packetLoss = packetLoss;
105 public String getIsp() {
109 public void setIsp(String isp) {
113 public Interface getInterface() {
114 return networkInterface;
117 public void setInterface(Interface networkInterface) {
118 this.networkInterface = networkInterface;
121 public Server getServer() {
125 public void setServer(Server server) {
126 this.server = server;
129 public Result getResult() {
133 public void setResult(Result result) {
134 this.result = result;
137 public class Download {
139 @SerializedName("bandwidth")
141 private String bandwidth;
142 @SerializedName("bytes")
144 private String bytes;
145 @SerializedName("elapsed")
147 private String elapsed;
149 public String getBandwidth() {
153 public void setBandwidth(String bandwidth) {
154 this.bandwidth = bandwidth;
157 public String getBytes() {
161 public void setBytes(String bytes) {
165 public String getElapsed() {
169 public void setElapsed(String elapsed) {
170 this.elapsed = elapsed;
174 public class Interface {
176 @SerializedName("internalIp")
178 private String internalIp;
179 @SerializedName("name")
182 @SerializedName("macAddr")
184 private String macAddr;
185 @SerializedName("isVpn")
187 private Boolean isVpn;
188 @SerializedName("externalIp")
190 private String externalIp;
192 public String getInternalIp() {
196 public void setInternalIp(String internalIp) {
197 this.internalIp = internalIp;
200 public String getName() {
204 public void setName(String name) {
208 public String getMacAddr() {
212 public void setMacAddr(String macAddr) {
213 this.macAddr = macAddr;
216 public Boolean getIsVpn() {
220 public void setIsVpn(Boolean isVpn) {
224 public String getExternalIp() {
228 public void setExternalIp(String externalIp) {
229 this.externalIp = externalIp;
235 @SerializedName("jitter")
237 private String jitter;
238 @SerializedName("latency")
240 private String latency;
242 public String getJitter() {
246 public void setJitter(String jitter) {
247 this.jitter = jitter;
250 public String getLatency() {
254 public void setLatency(String latency) {
255 this.latency = latency;
259 public class Result {
261 @SerializedName("id")
264 @SerializedName("url")
268 public String getId() {
272 public void setId(String id) {
276 public String getUrl() {
280 public void setUrl(String url) {
285 public class Server {
287 @SerializedName("id")
290 @SerializedName("name")
293 @SerializedName("location")
295 private String location;
296 @SerializedName("country")
298 private String country;
299 @SerializedName("host")
302 @SerializedName("port")
304 private Integer port;
305 @SerializedName("ip")
309 public Integer getId() {
313 public void setId(Integer id) {
317 public String getName() {
321 public void setName(String name) {
325 public String getLocation() {
329 public void setLocation(String location) {
330 this.location = location;
333 public String getCountry() {
337 public void setCountry(String country) {
338 this.country = country;
341 public String getHost() {
345 public void setHost(String host) {
349 public Integer getPort() {
353 public void setPort(Integer port) {
357 public String getIp() {
361 public void setIp(String ip) {
366 public class Upload {
368 @SerializedName("bandwidth")
370 private String bandwidth;
371 @SerializedName("bytes")
373 private String bytes;
374 @SerializedName("elapsed")
376 private String elapsed;
378 public String getBandwidth() {
382 public void setBandwidth(String bandwidth) {
383 this.bandwidth = bandwidth;
386 public String getBytes() {
390 public void setBytes(String bytes) {
394 public String getElapsed() {
398 public void setElapsed(String elapsed) {
399 this.elapsed = elapsed;