]> git.basschouten.com Git - openhab-addons.git/blob
07835f054ebe98e3e53c3c77bc27e5e0a0847f73
[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 LoginRequest
19 {
20     private String login;
21     private String password;
22
23     public String getLogin()
24     {
25         return login;
26     }
27
28     public void setLogin(String login)
29     {
30         this.login = login;
31     }
32
33     public LoginRequest withLogin(String login)
34     {
35         setLogin(login);
36         return this;
37     }
38
39     public String getPassword()
40     {
41         return password;
42     }
43
44     public void setPassword(String password)
45     {
46         this.password = password;
47     }
48
49     public LoginRequest withPassword(String password)
50     {
51         setPassword(password);
52         return this;
53     }
54
55     @Override
56     public int hashCode()
57     {
58         final int prime = 31;
59         int result = 1;
60         result = prime * result + ((login == null) ? 0 : login.hashCode());
61         result = prime * result + ((password == null) ? 0 : password.hashCode());
62         return result;
63     }
64
65     @Override
66     public boolean equals(Object obj)
67     {
68         if (this == obj)
69         {
70             return true;
71         }
72         if (obj == null)
73         {
74             return false;
75         }
76         if (!(obj instanceof LoginRequest))
77         {
78             return false;
79         }
80         LoginRequest other = (LoginRequest)obj;
81         if (login == null)
82         {
83             if (other.login != null)
84             {
85                 return false;
86             }
87         }
88         else if (!login.equals(other.login))
89         {
90             return false;
91         }
92         if (password == null)
93         {
94             if (other.password != null)
95             {
96                 return false;
97             }
98         }
99         else if (!password.equals(other.password))
100         {
101             return false;
102         }
103         return true;
104     }
105
106     @Override
107     public String toString()
108     {
109         StringBuilder builder = new StringBuilder();
110         builder.append("LoginRequest [login=");
111         builder.append(login);
112         builder.append(", password=");
113         builder.append(password);
114         builder.append("]");
115         return builder.toString();
116     }
117 }