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
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();
40 @SuppressWarnings("PMD.SimplifyBooleanReturns")
42 public boolean equals(@Nullable Object obj) {
46 if (!super.equals(obj)) {
52 if (getClass() != obj.getClass()) {
58 public static class CommunicationState {
60 private @Nullable String hardwareCarrierType;
61 private @Nullable String result;
62 private @Nullable String mediaType;
63 private Device device = new Device();
64 private @Nullable String testDate;
65 private @Nullable String typename;
67 public @Nullable String getHardwareCarrierType() {
68 return hardwareCarrierType;
71 public @Nullable String getResult() {
75 public @Nullable String getMediaType() {
79 public Device getDevice() {
83 public @Nullable String getTestDate() {
87 public @Nullable String getTypename() {
92 public int hashCode() {
95 result = prime * result + device.hashCode();
96 String locaHardwareCarrierType = hardwareCarrierType;
97 result = prime * result + ((locaHardwareCarrierType == null) ? 0 : locaHardwareCarrierType.hashCode());
98 String localMediaType = mediaType;
99 result = prime * result + ((localMediaType == null) ? 0 : localMediaType.hashCode());
100 String localResult = this.result;
101 result = prime * result + ((localResult == null) ? 0 : localResult.hashCode());
102 String localTestDate = testDate;
103 result = prime * result + ((localTestDate == null) ? 0 : localTestDate.hashCode());
104 String localTypeName = typename;
105 result = prime * result + ((localTypeName == null) ? 0 : localTypeName.hashCode());
110 public boolean equals(@Nullable Object obj) {
117 if (getClass() != obj.getClass()) {
120 CommunicationState other = (CommunicationState) obj;
121 if (!device.equals(other.device)) {
124 String locaHardwareCarrierType = hardwareCarrierType;
125 if (locaHardwareCarrierType == null) {
126 if (other.hardwareCarrierType != null) {
129 } else if (!locaHardwareCarrierType.equals(other.hardwareCarrierType)) {
132 String localMediaType = mediaType;
133 if (localMediaType == null) {
134 if (other.mediaType != null) {
137 } else if (!localMediaType.equals(other.mediaType)) {
140 String localResult = result;
141 if (localResult == null) {
142 if (other.result != null) {
145 } else if (!localResult.equals(other.result)) {
148 String localTestDate = testDate;
149 if (localTestDate == null) {
150 if (other.testDate != null) {
153 } else if (!localTestDate.equals(other.testDate)) {
156 String localTypeName = typename;
157 if (localTypeName == null) {
158 if (other.typename != null) {
161 } else if (!localTypeName.equals(other.typename)) {
168 public String toString() {
169 return "CommunicationState [hardwareCarrierType=" + hardwareCarrierType + ", result=" + result
170 + ", mediaType=" + mediaType + ", device=" + device + ", testDate=" + testDate + ", typename="