2 * Copyright 2017 Gregory Moyer
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.openhab.binding.sleepiq.api.model;
18 public class LoginInfo
20 private String userId;
22 private Long registrationState;
23 private Long edpLoginStatus;
24 private String edpLoginMessage;
26 public String getUserId()
31 public void setUserId(String userId)
36 public LoginInfo withUserId(String userId)
42 public String getKey()
47 public void setKey(String key)
52 public LoginInfo withKey(String key)
58 public Long getRegistrationState()
60 return registrationState;
63 public void setRegistrationState(Long registrationState)
65 this.registrationState = registrationState;
68 public LoginInfo withRegistrationState(Long registrationState)
70 setRegistrationState(registrationState);
74 public Long getEdpLoginStatus()
76 return edpLoginStatus;
79 public void setEdpLoginStatus(Long edpLoginStatus)
81 this.edpLoginStatus = edpLoginStatus;
84 public LoginInfo withEdpLoginStatus(Long edpLoginStatus)
86 setEdpLoginStatus(edpLoginStatus);
90 public String getEdpLoginMessage()
92 return edpLoginMessage;
95 public void setEdpLoginMessage(String edpLoginMessage)
97 this.edpLoginMessage = edpLoginMessage;
100 public LoginInfo withEdpLoginMessage(String edpLoginMessage)
102 setEdpLoginMessage(edpLoginMessage);
107 public int hashCode()
109 final int prime = 31;
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());
118 public boolean equals(Object obj)
128 if (!(obj instanceof LoginInfo))
132 LoginInfo other = (LoginInfo)obj;
135 if (other.key != null)
140 else if (!key.equals(other.key))
144 if (!registrationState.equals(other.registrationState))
150 if (other.userId != null)
155 else if (!userId.equals(other.userId))
163 public String toString()
165 StringBuilder builder = new StringBuilder();
166 builder.append("LoginInfo [userId=");
167 builder.append(userId);
168 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);
177 return builder.toString();