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 LoginRequest} holds the Login request sent to the sleepiq API.
18 * @author Gregory Moyer - Initial contribution
20 public class LoginRequest {
22 private String password;
24 public String getLogin() {
28 public void setLogin(String login) {
32 public LoginRequest withLogin(String login) {
37 public String getPassword() {
41 public void setPassword(String password) {
42 this.password = password;
45 public LoginRequest withPassword(String password) {
46 setPassword(password);
51 public int hashCode() {
54 result = prime * result + ((login == null) ? 0 : login.hashCode());
55 result = prime * result + ((password == null) ? 0 : password.hashCode());
60 public boolean equals(Object obj) {
67 if (!(obj instanceof LoginRequest)) {
70 LoginRequest other = (LoginRequest) obj;
72 if (other.login != null) {
75 } else if (!login.equals(other.login)) {
78 if (password == null) {
79 if (other.password != null) {
82 } else if (!password.equals(other.password)) {
89 public String toString() {
90 StringBuilder builder = new StringBuilder();
91 builder.append("LoginRequest [login=");
92 builder.append(login);
93 builder.append(", password=");
94 builder.append(password);
96 return builder.toString();