]> git.basschouten.com Git - openhab-addons.git/blob
c8342cc9e5bec5052f6f360acad84de8e7a4fb49
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.sleepiq.internal.api.dto;
14
15 import java.time.ZonedDateTime;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * The {@link Bed} holds the bed response from the sleepiq API.
21  *
22  * @author Gregory Moyer - Initial contribution
23  */
24 public class Bed {
25     private ZonedDateTime registrationDate;
26     private String sleeperRightId;
27     private String base;
28     private Long returnRequestStatus;
29     private String size;
30     private String name;
31     private String serial;
32     @SerializedName("isKidsBed")
33     private Boolean kidsBed;
34     private Boolean dualSleep;
35     private String bedId;
36     private Long status;
37     private String sleeperLeftId;
38     private String version;
39     private String accountId;
40     private String timezone;
41     private String model;
42     private ZonedDateTime purchaseDate;
43     private String macAddress;
44     private String sku;
45     @SerializedName("zipcode")
46     private String zipCode;
47     private String reference;
48
49     public ZonedDateTime getRegistrationDate() {
50         return registrationDate;
51     }
52
53     public void setRegistrationDate(ZonedDateTime registrationDate) {
54         this.registrationDate = registrationDate;
55     }
56
57     public Bed withRegistrationDate(ZonedDateTime registrationDate) {
58         setRegistrationDate(registrationDate);
59         return this;
60     }
61
62     public String getSleeperRightId() {
63         return sleeperRightId;
64     }
65
66     public void setSleeperRightId(String sleeperRightId) {
67         this.sleeperRightId = sleeperRightId;
68     }
69
70     public Bed withSleeperRightId(String sleeperRightId) {
71         setSleeperRightId(sleeperRightId);
72         return this;
73     }
74
75     public String getBase() {
76         return base;
77     }
78
79     public void setBase(String base) {
80         this.base = base;
81     }
82
83     public Bed withBase(String base) {
84         setBase(base);
85         return this;
86     }
87
88     public Long getReturnRequestStatus() {
89         return returnRequestStatus;
90     }
91
92     public void setReturnRequestStatus(Long returnRequestStatus) {
93         this.returnRequestStatus = returnRequestStatus;
94     }
95
96     public Bed withReturnRequestStatus(Long returnRequestStatus) {
97         setReturnRequestStatus(returnRequestStatus);
98         return this;
99     }
100
101     public String getSize() {
102         return size;
103     }
104
105     public void setSize(String size) {
106         this.size = size;
107     }
108
109     public Bed withSize(String size) {
110         setSize(size);
111         return this;
112     }
113
114     public String getName() {
115         return name;
116     }
117
118     public void setName(String name) {
119         this.name = name;
120     }
121
122     public Bed withName(String name) {
123         setName(name);
124         return this;
125     }
126
127     public String getSerial() {
128         return serial;
129     }
130
131     public void setSerial(String serial) {
132         this.serial = serial;
133     }
134
135     public Bed withSerial(String serial) {
136         setSerial(serial);
137         return this;
138     }
139
140     public Boolean isKidsBed() {
141         return kidsBed;
142     }
143
144     public void setKidsBed(Boolean kidsBed) {
145         this.kidsBed = kidsBed;
146     }
147
148     public Bed withKidsBed(Boolean kidsBed) {
149         setKidsBed(kidsBed);
150         return this;
151     }
152
153     public Boolean isDualSleep() {
154         return dualSleep;
155     }
156
157     public void setDualSleep(Boolean dualSleep) {
158         this.dualSleep = dualSleep;
159     }
160
161     public Bed withDualSleep(Boolean dualSleep) {
162         setDualSleep(dualSleep);
163         return this;
164     }
165
166     public String getBedId() {
167         return bedId;
168     }
169
170     public void setBedId(String bedId) {
171         this.bedId = bedId;
172     }
173
174     public Bed withBedId(String bedId) {
175         setBedId(bedId);
176         return this;
177     }
178
179     public Long getStatus() {
180         return status;
181     }
182
183     public void setStatus(Long status) {
184         this.status = status;
185     }
186
187     public Bed withStatus(Long status) {
188         setStatus(status);
189         return this;
190     }
191
192     public String getSleeperLeftId() {
193         return sleeperLeftId;
194     }
195
196     public void setSleeperLeftId(String sleeperLeftId) {
197         this.sleeperLeftId = sleeperLeftId;
198     }
199
200     public Bed withSleeperLeftId(String sleeperLeftId) {
201         setSleeperLeftId(sleeperLeftId);
202         return this;
203     }
204
205     public String getVersion() {
206         return version;
207     }
208
209     public void setVersion(String version) {
210         this.version = version;
211     }
212
213     public Bed withVersion(String version) {
214         setVersion(version);
215         return this;
216     }
217
218     public String getAccountId() {
219         return accountId;
220     }
221
222     public void setAccountId(String accountId) {
223         this.accountId = accountId;
224     }
225
226     public Bed withAccountId(String accountId) {
227         setAccountId(accountId);
228         return this;
229     }
230
231     public String getTimezone() {
232         return timezone;
233     }
234
235     public void setTimezone(String timezone) {
236         this.timezone = timezone;
237     }
238
239     public Bed withTimezone(String timezone) {
240         setTimezone(timezone);
241         return this;
242     }
243
244     public String getModel() {
245         return model;
246     }
247
248     public void setModel(String model) {
249         this.model = model;
250     }
251
252     public Bed withModel(String model) {
253         setModel(model);
254         return this;
255     }
256
257     public ZonedDateTime getPurchaseDate() {
258         return purchaseDate;
259     }
260
261     public void setPurchaseDate(ZonedDateTime purchaseDate) {
262         this.purchaseDate = purchaseDate;
263     }
264
265     public Bed withPurchaseDate(ZonedDateTime purchaseDate) {
266         setPurchaseDate(purchaseDate);
267         return this;
268     }
269
270     public String getMacAddress() {
271         return macAddress;
272     }
273
274     public void setMacAddress(String macAddress) {
275         this.macAddress = macAddress;
276     }
277
278     public Bed withMacAddress(String macAddress) {
279         setMacAddress(macAddress);
280         return this;
281     }
282
283     public String getSku() {
284         return sku;
285     }
286
287     public void setSku(String sku) {
288         this.sku = sku;
289     }
290
291     public Bed withSku(String sku) {
292         setSku(sku);
293         return this;
294     }
295
296     public String getZipCode() {
297         return zipCode;
298     }
299
300     public void setZipCode(String zipCode) {
301         this.zipCode = zipCode;
302     }
303
304     public Bed withZipCode(String zipCode) {
305         setZipCode(zipCode);
306         return this;
307     }
308
309     public String getReference() {
310         return reference;
311     }
312
313     public void setReference(String reference) {
314         this.reference = reference;
315     }
316
317     public Bed withReference(String reference) {
318         setReference(reference);
319         return this;
320     }
321
322     @Override
323     public int hashCode() {
324         final int prime = 31;
325         int result = 1;
326         result = prime * result + ((bedId == null) ? 0 : bedId.hashCode());
327         return result;
328     }
329
330     @Override
331     public boolean equals(Object obj) {
332         if (this == obj) {
333             return true;
334         }
335         if (obj == null) {
336             return false;
337         }
338         if (!(obj instanceof Bed)) {
339             return false;
340         }
341         Bed other = (Bed) obj;
342         if (bedId == null) {
343             if (other.bedId != null) {
344                 return false;
345             }
346         } else if (!bedId.equals(other.bedId)) {
347             return false;
348         }
349         return true;
350     }
351
352     @Override
353     public String toString() {
354         StringBuilder builder = new StringBuilder();
355         builder.append("Bed [registrationDate=");
356         builder.append(registrationDate);
357         builder.append(", sleeperRightId=");
358         builder.append(sleeperRightId);
359         builder.append(", base=");
360         builder.append(base);
361         builder.append(", returnRequestStatus=");
362         builder.append(returnRequestStatus);
363         builder.append(", size=");
364         builder.append(size);
365         builder.append(", name=");
366         builder.append(name);
367         builder.append(", serial=");
368         builder.append(serial);
369         builder.append(", kidsBed=");
370         builder.append(kidsBed);
371         builder.append(", dualSleep=");
372         builder.append(dualSleep);
373         builder.append(", bedId=");
374         builder.append(bedId);
375         builder.append(", status=");
376         builder.append(status);
377         builder.append(", sleeperLeftId=");
378         builder.append(sleeperLeftId);
379         builder.append(", version=");
380         builder.append(version);
381         builder.append(", accountId=");
382         builder.append(accountId);
383         builder.append(", timezone=");
384         builder.append(timezone);
385         builder.append(", model=");
386         builder.append(model);
387         builder.append(", purchaseDate=");
388         builder.append(purchaseDate);
389         builder.append(", macAddress=");
390         builder.append(macAddress);
391         builder.append(", sku=");
392         builder.append(sku);
393         builder.append(", zipCode=");
394         builder.append(zipCode);
395         builder.append(", reference=");
396         builder.append(reference);
397         builder.append("]");
398         return builder.toString();
399     }
400 }