]> git.basschouten.com Git - openhab-addons.git/blob
7cc35096fb6e08e3df4a41de2e462c0c065e8abd
[openhab-addons.git] /
1 /*
2  * Copyright 2017 Gregory Moyer
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.openhab.binding.sleepiq.api.model;
17
18 public class LoginInfo
19 {
20     private String userId;
21     private String key;
22     private Long registrationState;
23     private Long edpLoginStatus;
24     private String edpLoginMessage;
25
26     public String getUserId()
27     {
28         return userId;
29     }
30
31     public void setUserId(String userId)
32     {
33         this.userId = userId;
34     }
35
36     public LoginInfo withUserId(String userId)
37     {
38         setUserId(userId);
39         return this;
40     }
41
42     public String getKey()
43     {
44         return key;
45     }
46
47     public void setKey(String key)
48     {
49         this.key = key;
50     }
51
52     public LoginInfo withKey(String key)
53     {
54         setKey(key);
55         return this;
56     }
57
58     public Long getRegistrationState()
59     {
60         return registrationState;
61     }
62
63     public void setRegistrationState(Long registrationState)
64     {
65         this.registrationState = registrationState;
66     }
67
68     public LoginInfo withRegistrationState(Long registrationState)
69     {
70         setRegistrationState(registrationState);
71         return this;
72     }
73
74     public Long getEdpLoginStatus()
75     {
76         return edpLoginStatus;
77     }
78
79     public void setEdpLoginStatus(Long edpLoginStatus)
80     {
81         this.edpLoginStatus = edpLoginStatus;
82     }
83
84     public LoginInfo withEdpLoginStatus(Long edpLoginStatus)
85     {
86         setEdpLoginStatus(edpLoginStatus);
87         return this;
88     }
89
90     public String getEdpLoginMessage()
91     {
92         return edpLoginMessage;
93     }
94
95     public void setEdpLoginMessage(String edpLoginMessage)
96     {
97         this.edpLoginMessage = edpLoginMessage;
98     }
99
100     public LoginInfo withEdpLoginMessage(String edpLoginMessage)
101     {
102         setEdpLoginMessage(edpLoginMessage);
103         return this;
104     }
105
106     @Override
107     public int hashCode()
108     {
109         final int prime = 31;
110         int result = 1;
111         result = prime * result + ((key == null) ? 0 : key.hashCode());
112         result = prime * result + (int)(registrationState ^ (registrationState >>> 32));
113         result = prime * result + ((userId == null) ? 0 : userId.hashCode());
114         return result;
115     }
116
117     @Override
118     public boolean equals(Object obj)
119     {
120         if (this == obj)
121         {
122             return true;
123         }
124         if (obj == null)
125         {
126             return false;
127         }
128         if (!(obj instanceof LoginInfo))
129         {
130             return false;
131         }
132         LoginInfo other = (LoginInfo)obj;
133         if (key == null)
134         {
135             if (other.key != null)
136             {
137                 return false;
138             }
139         }
140         else if (!key.equals(other.key))
141         {
142             return false;
143         }
144         if (!registrationState.equals(other.registrationState))
145         {
146             return false;
147         }
148         if (userId == null)
149         {
150             if (other.userId != null)
151             {
152                 return false;
153             }
154         }
155         else if (!userId.equals(other.userId))
156         {
157             return false;
158         }
159         return true;
160     }
161
162     @Override
163     public String toString()
164     {
165         StringBuilder builder = new StringBuilder();
166         builder.append("LoginInfo [userId=");
167         builder.append(userId);
168         builder.append(", key=");
169         builder.append(key);
170         builder.append(", registrationState=");
171         builder.append(registrationState);
172         builder.append(", edpLoginStatus=");
173         builder.append(edpLoginStatus);
174         builder.append(", edpLoginMessage=");
175         builder.append(edpLoginMessage);
176         builder.append("]");
177         return builder.toString();
178     }
179 }