]> git.basschouten.com Git - openhab-addons.git/blob
9f51fc92f7c8aa2f2528ed7ded6f1718afbb230e
[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.sleepiq.internal.api.dto;
14
15 /**
16  * The {@link LoginInfo} holds the LoginInfo response from the sleepiq API.
17  *
18  * @author Gregory Moyer - Initial contribution
19  */
20 public class LoginInfo {
21     private String userId;
22     private String key;
23     private Long registrationState;
24     private Long edpLoginStatus;
25     private String edpLoginMessage;
26
27     public String getUserId() {
28         return userId;
29     }
30
31     public void setUserId(String userId) {
32         this.userId = userId;
33     }
34
35     public LoginInfo withUserId(String userId) {
36         setUserId(userId);
37         return this;
38     }
39
40     public String getKey() {
41         return key;
42     }
43
44     public void setKey(String key) {
45         this.key = key;
46     }
47
48     public LoginInfo withKey(String key) {
49         setKey(key);
50         return this;
51     }
52
53     public Long getRegistrationState() {
54         return registrationState;
55     }
56
57     public void setRegistrationState(Long registrationState) {
58         this.registrationState = registrationState;
59     }
60
61     public LoginInfo withRegistrationState(Long registrationState) {
62         setRegistrationState(registrationState);
63         return this;
64     }
65
66     public Long getEdpLoginStatus() {
67         return edpLoginStatus;
68     }
69
70     public void setEdpLoginStatus(Long edpLoginStatus) {
71         this.edpLoginStatus = edpLoginStatus;
72     }
73
74     public LoginInfo withEdpLoginStatus(Long edpLoginStatus) {
75         setEdpLoginStatus(edpLoginStatus);
76         return this;
77     }
78
79     public String getEdpLoginMessage() {
80         return edpLoginMessage;
81     }
82
83     public void setEdpLoginMessage(String edpLoginMessage) {
84         this.edpLoginMessage = edpLoginMessage;
85     }
86
87     public LoginInfo withEdpLoginMessage(String edpLoginMessage) {
88         setEdpLoginMessage(edpLoginMessage);
89         return this;
90     }
91
92     @Override
93     public int hashCode() {
94         final int prime = 31;
95         int result = 1;
96         result = prime * result + ((key == null) ? 0 : key.hashCode());
97         result = prime * result + (int) (registrationState ^ (registrationState >>> 32));
98         result = prime * result + ((userId == null) ? 0 : userId.hashCode());
99         return result;
100     }
101
102     @Override
103     public boolean equals(Object obj) {
104         if (this == obj) {
105             return true;
106         }
107         if (obj == null) {
108             return false;
109         }
110         if (!(obj instanceof LoginInfo)) {
111             return false;
112         }
113         LoginInfo other = (LoginInfo) obj;
114         if (key == null) {
115             if (other.key != null) {
116                 return false;
117             }
118         } else if (!key.equals(other.key)) {
119             return false;
120         }
121         if (!registrationState.equals(other.registrationState)) {
122             return false;
123         }
124         if (userId == null) {
125             if (other.userId != null) {
126                 return false;
127             }
128         } else if (!userId.equals(other.userId)) {
129             return false;
130         }
131         return true;
132     }
133
134     @Override
135     public String toString() {
136         StringBuilder builder = new StringBuilder();
137         builder.append("LoginInfo [userId=");
138         builder.append(userId);
139         builder.append(", key=");
140         builder.append(key);
141         builder.append(", registrationState=");
142         builder.append(registrationState);
143         builder.append(", edpLoginStatus=");
144         builder.append(edpLoginStatus);
145         builder.append(", edpLoginMessage=");
146         builder.append(edpLoginMessage);
147         builder.append("]");
148         return builder.toString();
149     }
150 }