]> git.basschouten.com Git - openhab-addons.git/blob
21350bb6e7bd5f868e15f336fb37a5cf3f9d5778
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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 WWN meta data in the data downloads.
17  *
18  * @author David Bennett - Initial contribution
19  * @author Wouter Born - Add equals and hashCode methods
20  */
21 public class WWNMetadata {
22
23     private String accessToken;
24     private String clientVersion;
25
26     public String getAccessToken() {
27         return accessToken;
28     }
29
30     public String getClientVersion() {
31         return clientVersion;
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         WWNMetadata other = (WWNMetadata) obj;
46         if (accessToken == null) {
47             if (other.accessToken != null) {
48                 return false;
49             }
50         } else if (!accessToken.equals(other.accessToken)) {
51             return false;
52         }
53         if (clientVersion == null) {
54             if (other.clientVersion != null) {
55                 return false;
56             }
57         } else if (!clientVersion.equals(other.clientVersion)) {
58             return false;
59         }
60         return true;
61     }
62
63     @Override
64     public int hashCode() {
65         final int prime = 31;
66         int result = 1;
67         result = prime * result + ((accessToken == null) ? 0 : accessToken.hashCode());
68         result = prime * result + ((clientVersion == null) ? 0 : clientVersion.hashCode());
69         return result;
70     }
71
72     @Override
73     public String toString() {
74         StringBuilder builder = new StringBuilder();
75         builder.append("NestMetadata [accessToken=").append(accessToken).append(", clientVersion=")
76                 .append(clientVersion).append("]");
77         return builder.toString();
78     }
79 }