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_BROADBAND_CONNECTION;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.core.thing.ThingTypeUID;
21 import com.google.gson.annotations.SerializedName;
24 * The broadband connections of the Verisure System.
26 * @author Jan Gustafsson - Initial contribution
30 public class VerisureBroadbandConnectionsDTO extends VerisureBaseThingDTO {
33 public ThingTypeUID getThingTypeUID() {
34 return THING_TYPE_BROADBAND_CONNECTION;
38 public int hashCode() {
39 return super.hashCode();
42 @SuppressWarnings("PMD.SimplifyBooleanReturns")
44 public boolean equals(@Nullable Object obj) {
48 if (!super.equals(obj)) {
54 if (getClass() != obj.getClass()) {
60 public static class Broadband {
62 private @Nullable String testDate;
63 private boolean isBroadbandConnected;
64 @SerializedName("__typename")
65 private @Nullable String typename;
67 public @Nullable String getTestDate() {
71 public boolean isBroadbandConnected() {
72 return isBroadbandConnected;
75 public @Nullable String getTypename() {
80 public int hashCode() {
83 result = prime * result + (isBroadbandConnected ? 1231 : 1237);
84 String localTestDate = testDate;
85 result = prime * result + ((localTestDate == null) ? 0 : localTestDate.hashCode());
86 String localTypeName = typename;
87 result = prime * result + ((localTypeName == null) ? 0 : localTypeName.hashCode());
92 public boolean equals(@Nullable Object obj) {
99 if (getClass() != obj.getClass()) {
102 Broadband other = (Broadband) obj;
103 if (isBroadbandConnected != other.isBroadbandConnected) {
106 String localTestDate = testDate;
107 if (localTestDate == null) {
108 if (other.testDate != null) {
111 } else if (!localTestDate.equals(other.testDate)) {
114 String localTypeName = typename;
115 if (localTypeName == null) {
116 if (other.typename != null) {
119 } else if (!localTypeName.equals(other.typename)) {
126 public String toString() {
127 return "Broadband [testDate=" + testDate + ", isBroadbandConnected=" + isBroadbandConnected + ", typename="