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;
16 * @author David Bennett - Initial contribution
17 * @author Wouter Born - Extract Where object from Structure
18 * @author Wouter Born - Add equals, hashCode, toString methods
20 public class WWNWhere {
21 private String whereId;
24 public String getWhereId() {
28 public String getName() {
33 public boolean equals(Object obj) {
40 if (getClass() != obj.getClass()) {
43 WWNWhere other = (WWNWhere) obj;
45 if (other.name != null) {
48 } else if (!name.equals(other.name)) {
51 if (whereId == null) {
52 if (other.whereId != null) {
55 } else if (!whereId.equals(other.whereId)) {
62 public int hashCode() {
65 result = prime * result + ((name == null) ? 0 : name.hashCode());
66 result = prime * result + ((whereId == null) ? 0 : whereId.hashCode());
71 public String toString() {
72 StringBuilder builder = new StringBuilder();
73 builder.append("Where [whereId=").append(whereId).append(", name=").append(name).append("]");
74 return builder.toString();