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.nest.internal.wwn.dto;
18 * All the WWN devices broken up by type.
20 * @author David Bennett - Initial contribution
22 public class WWNDevices {
24 private Map<String, WWNThermostat> thermostats;
25 private Map<String, WWNSmokeDetector> smokeCoAlarms;
26 private Map<String, WWNCamera> cameras;
28 /** Id to thermostat mapping */
29 public Map<String, WWNThermostat> getThermostats() {
33 /** Id to camera mapping */
34 public Map<String, WWNCamera> getCameras() {
38 /** Id to smoke detector */
39 public Map<String, WWNSmokeDetector> getSmokeCoAlarms() {
44 public boolean equals(Object obj) {
51 if (getClass() != obj.getClass()) {
54 WWNDevices other = (WWNDevices) obj;
55 if (cameras == null) {
56 if (other.cameras != null) {
59 } else if (!cameras.equals(other.cameras)) {
62 if (smokeCoAlarms == null) {
63 if (other.smokeCoAlarms != null) {
66 } else if (!smokeCoAlarms.equals(other.smokeCoAlarms)) {
69 if (thermostats == null) {
70 if (other.thermostats != null) {
73 } else if (!thermostats.equals(other.thermostats)) {
80 public int hashCode() {
83 result = prime * result + ((cameras == null) ? 0 : cameras.hashCode());
84 result = prime * result + ((smokeCoAlarms == null) ? 0 : smokeCoAlarms.hashCode());
85 result = prime * result + ((thermostats == null) ? 0 : thermostats.hashCode());
90 public String toString() {
91 StringBuilder builder = new StringBuilder();
92 builder.append("NestDevices [thermostats=").append(thermostats).append(", smokeCoAlarms=").append(smokeCoAlarms)
93 .append(", cameras=").append(cameras).append("]");
94 return builder.toString();