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_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();
43 public boolean equals(@Nullable Object obj) {
47 if (!super.equals(obj)) {
53 if (getClass() != obj.getClass()) {
59 public static class Broadband {
61 private @Nullable String testDate;
62 private boolean isBroadbandConnected;
63 @SerializedName("__typename")
64 private @Nullable String typename;
66 public @Nullable String getTestDate() {
70 public boolean isBroadbandConnected() {
71 return isBroadbandConnected;
74 public @Nullable String getTypename() {
79 public int hashCode() {
82 result = prime * result + (isBroadbandConnected ? 1231 : 1237);
83 String localTestDate = testDate;
84 result = prime * result + ((localTestDate == null) ? 0 : localTestDate.hashCode());
85 String localTypeName = typename;
86 result = prime * result + ((localTypeName == null) ? 0 : localTypeName.hashCode());
91 public boolean equals(@Nullable Object obj) {
98 if (getClass() != obj.getClass()) {
101 Broadband other = (Broadband) obj;
102 if (isBroadbandConnected != other.isBroadbandConnected) {
105 String localTestDate = testDate;
106 if (localTestDate == null) {
107 if (other.testDate != null) {
110 } else if (!localTestDate.equals(other.testDate)) {
113 String localTypeName = typename;
114 if (localTypeName == null) {
115 if (other.typename != null) {
118 } else if (!localTypeName.equals(other.typename)) {
125 public String toString() {
126 return "Broadband [testDate=" + testDate + ", isBroadbandConnected=" + isBroadbandConnected + ", typename="