]> git.basschouten.com Git - openhab-addons.git/blob
64c7c83b7e6a7029acba3d24fcc48ef05a71cde2
[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 package org.openhab.binding.revogi.internal.api;
14
15 import java.util.Objects;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * @author Andi Bräu - Initial contribution
21  */
22 public class DiscoveryResponseDTO {
23     @SerializedName("sn")
24     private final String serialNumber;
25     @SerializedName("regid")
26     private final String regId;
27     private final String sak;
28     private final String name;
29     @SerializedName("mac")
30     private final String macAddress;
31     @SerializedName("ver")
32     private final String version;
33
34     public DiscoveryResponseDTO(String serialNumber, String regId, String sak, String name, String macAddress,
35             String version) {
36         this.serialNumber = serialNumber;
37         this.regId = regId;
38         this.sak = sak;
39         this.name = name;
40         this.macAddress = macAddress;
41         this.version = version;
42     }
43
44     public DiscoveryResponseDTO() {
45         serialNumber = "";
46         regId = "";
47         sak = "";
48         name = "";
49         macAddress = "";
50         version = "";
51     }
52
53     public String getSerialNumber() {
54         return serialNumber;
55     }
56
57     public String getRegId() {
58         return regId;
59     }
60
61     public String getSak() {
62         return sak;
63     }
64
65     public String getName() {
66         return name;
67     }
68
69     public String getMacAddress() {
70         return macAddress;
71     }
72
73     public String getVersion() {
74         return version;
75     }
76
77     @Override
78     public boolean equals(Object o) {
79         if (this == o) {
80             return true;
81         }
82         if (o == null || getClass() != o.getClass()) {
83             return false;
84         }
85         DiscoveryResponseDTO that = (DiscoveryResponseDTO) o;
86         return serialNumber.equals(that.serialNumber) && regId.equals(that.regId) && sak.equals(that.sak)
87                 && name.equals(that.name) && macAddress.equals(that.macAddress) && version.equals(that.version);
88     }
89
90     @Override
91     public int hashCode() {
92         return Objects.hash(serialNumber, regId, sak, name, macAddress, version);
93     }
94 }