2 * Copyright (c) 2010-2022 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
13 package org.openhab.binding.verisure.internal.dto;
15 import static org.openhab.binding.verisure.internal.VerisureBindingConstants.THING_TYPE_GATEWAY;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.core.thing.ThingTypeUID;
22 * The gateway in the Verisure System.
24 * @author Jan Gustafsson - Initial contribution
28 public class VerisureGatewayDTO extends VerisureBaseThingDTO {
31 public ThingTypeUID getThingTypeUID() {
32 return THING_TYPE_GATEWAY;
36 public int hashCode() {
37 return super.hashCode();
41 public boolean equals(@Nullable Object obj) {
45 if (!super.equals(obj)) {
51 if (getClass() != obj.getClass()) {
57 public static class CommunicationState {
59 private @Nullable String hardwareCarrierType;
60 private @Nullable String result;
61 private @Nullable String mediaType;
62 private Device device = new Device();
63 private @Nullable String testDate;
64 private @Nullable String typename;
66 public @Nullable String getHardwareCarrierType() {
67 return hardwareCarrierType;
70 public @Nullable String getResult() {
74 public @Nullable String getMediaType() {
78 public Device getDevice() {
82 public @Nullable String getTestDate() {
86 public @Nullable String getTypename() {
91 public int hashCode() {
94 result = prime * result + device.hashCode();
95 String locaHardwareCarrierType = hardwareCarrierType;
96 result = prime * result + ((locaHardwareCarrierType == null) ? 0 : locaHardwareCarrierType.hashCode());
97 String localMediaType = mediaType;
98 result = prime * result + ((localMediaType == null) ? 0 : localMediaType.hashCode());
99 String localResult = this.result;
100 result = prime * result + ((localResult == null) ? 0 : localResult.hashCode());
101 String localTestDate = testDate;
102 result = prime * result + ((localTestDate == null) ? 0 : localTestDate.hashCode());
103 String localTypeName = typename;
104 result = prime * result + ((localTypeName == null) ? 0 : localTypeName.hashCode());
109 public boolean equals(@Nullable Object obj) {
116 if (getClass() != obj.getClass()) {
119 CommunicationState other = (CommunicationState) obj;
120 if (!device.equals(other.device)) {
123 String locaHardwareCarrierType = hardwareCarrierType;
124 if (locaHardwareCarrierType == null) {
125 if (other.hardwareCarrierType != null) {
128 } else if (!locaHardwareCarrierType.equals(other.hardwareCarrierType)) {
131 String localMediaType = mediaType;
132 if (localMediaType == null) {
133 if (other.mediaType != null) {
136 } else if (!localMediaType.equals(other.mediaType)) {
139 String localResult = result;
140 if (localResult == null) {
141 if (other.result != null) {
144 } else if (!localResult.equals(other.result)) {
147 String localTestDate = testDate;
148 if (localTestDate == null) {
149 if (other.testDate != null) {
152 } else if (!localTestDate.equals(other.testDate)) {
155 String localTypeName = typename;
156 if (localTypeName == null) {
157 if (other.typename != null) {
160 } else if (!localTypeName.equals(other.typename)) {
167 public String toString() {
168 return "CommunicationState [hardwareCarrierType=" + hardwareCarrierType + ", result=" + result
169 + ", mediaType=" + mediaType + ", device=" + device + ", testDate=" + testDate + ", typename="