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.nest.internal.wwn.dto;
18 * The top level WWN data that is sent by Nest.
20 * @author David Bennett - Initial contribution
21 * @author Wouter Born - Add equals and hashCode methods
23 public class WWNTopLevelData {
25 private WWNDevices devices;
26 private WWNMetadata metadata;
27 private Map<String, WWNStructure> structures;
29 public WWNDevices getDevices() {
33 public WWNMetadata getMetadata() {
37 public Map<String, WWNStructure> getStructures() {
42 public boolean equals(Object obj) {
49 if (getClass() != obj.getClass()) {
52 WWNTopLevelData other = (WWNTopLevelData) obj;
53 if (devices == null) {
54 if (other.devices != null) {
57 } else if (!devices.equals(other.devices)) {
60 if (metadata == null) {
61 if (other.metadata != null) {
64 } else if (!metadata.equals(other.metadata)) {
67 if (structures == null) {
68 if (other.structures != null) {
71 } else if (!structures.equals(other.structures)) {
78 public int hashCode() {
81 result = prime * result + ((devices == null) ? 0 : devices.hashCode());
82 result = prime * result + ((metadata == null) ? 0 : metadata.hashCode());
83 result = prime * result + ((structures == null) ? 0 : structures.hashCode());
88 public String toString() {
89 StringBuilder builder = new StringBuilder();
90 builder.append("TopLevelData [devices=").append(devices).append(", metadata=").append(metadata)
91 .append(", structures=").append(structures).append("]");
92 return builder.toString();