2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.sleepiq.internal.api.dto;
16 * The {@link LoginInfo} holds the LoginInfo response from the sleepiq API.
18 * @author Gregory Moyer - Initial contribution
20 public class LoginInfo {
21 private String userId;
23 private Long registrationState;
24 private Long edpLoginStatus;
25 private String edpLoginMessage;
27 public String getUserId() {
31 public void setUserId(String userId) {
35 public LoginInfo withUserId(String userId) {
40 public String getKey() {
44 public void setKey(String key) {
48 public LoginInfo withKey(String key) {
53 public Long getRegistrationState() {
54 return registrationState;
57 public void setRegistrationState(Long registrationState) {
58 this.registrationState = registrationState;
61 public LoginInfo withRegistrationState(Long registrationState) {
62 setRegistrationState(registrationState);
66 public Long getEdpLoginStatus() {
67 return edpLoginStatus;
70 public void setEdpLoginStatus(Long edpLoginStatus) {
71 this.edpLoginStatus = edpLoginStatus;
74 public LoginInfo withEdpLoginStatus(Long edpLoginStatus) {
75 setEdpLoginStatus(edpLoginStatus);
79 public String getEdpLoginMessage() {
80 return edpLoginMessage;
83 public void setEdpLoginMessage(String edpLoginMessage) {
84 this.edpLoginMessage = edpLoginMessage;
87 public LoginInfo withEdpLoginMessage(String edpLoginMessage) {
88 setEdpLoginMessage(edpLoginMessage);
93 public int hashCode() {
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());
103 public boolean equals(Object obj) {
110 if (!(obj instanceof LoginInfo)) {
113 LoginInfo other = (LoginInfo) obj;
115 if (other.key != null) {
118 } else if (!key.equals(other.key)) {
121 if (!registrationState.equals(other.registrationState)) {
124 if (userId == null) {
125 if (other.userId != null) {
128 } else if (!userId.equals(other.userId)) {
135 public String toString() {
136 StringBuilder builder = new StringBuilder();
137 builder.append("LoginInfo [userId=");
138 builder.append(userId);
139 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);
148 return builder.toString();