]> git.basschouten.com Git - openhab-addons.git/blob
6b3cac3ce248e4e14229186311c0142f85d8dff0
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.nest.internal.wwn.dto;
14
15 /**
16  * The data for a WWN camera activity zone.
17  *
18  * @author David Bennett - Initial contribution
19  * @author Wouter Born - Extract ActivityZone object from Camera
20  */
21 public class WWNActivityZone {
22
23     private String name;
24     private int id;
25
26     public String getName() {
27         return name;
28     }
29
30     public int getId() {
31         return id;
32     }
33
34     @Override
35     public boolean equals(Object obj) {
36         if (this == obj) {
37             return true;
38         }
39         if (obj == null) {
40             return false;
41         }
42         if (getClass() != obj.getClass()) {
43             return false;
44         }
45         WWNActivityZone other = (WWNActivityZone) obj;
46         if (id != other.id) {
47             return false;
48         }
49         if (name == null) {
50             if (other.name != null) {
51                 return false;
52             }
53         } else if (!name.equals(other.name)) {
54             return false;
55         }
56         return true;
57     }
58
59     @Override
60     public int hashCode() {
61         final int prime = 31;
62         int result = 1;
63         result = prime * result + id;
64         result = prime * result + ((name == null) ? 0 : name.hashCode());
65         return result;
66     }
67
68     @Override
69     public String toString() {
70         StringBuilder builder = new StringBuilder();
71         builder.append("CameraActivityZone [name=").append(name).append(", id=").append(id).append("]");
72         return builder.toString();
73     }
74 }