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;
15 import java.time.ZonedDateTime;
17 import com.google.gson.annotations.SerializedName;
20 * The {@link Bed} holds the bed response from the sleepiq API.
22 * @author Gregory Moyer - Initial contribution
25 private ZonedDateTime registrationDate;
26 private String sleeperRightId;
28 private Long returnRequestStatus;
31 private String serial;
32 @SerializedName("isKidsBed")
33 private Boolean kidsBed;
34 private Boolean dualSleep;
37 private String sleeperLeftId;
38 private String version;
39 private String accountId;
40 private String timezone;
42 private ZonedDateTime purchaseDate;
43 private String macAddress;
45 @SerializedName("zipcode")
46 private String zipCode;
47 private String reference;
49 public ZonedDateTime getRegistrationDate() {
50 return registrationDate;
53 public void setRegistrationDate(ZonedDateTime registrationDate) {
54 this.registrationDate = registrationDate;
57 public Bed withRegistrationDate(ZonedDateTime registrationDate) {
58 setRegistrationDate(registrationDate);
62 public String getSleeperRightId() {
63 return sleeperRightId;
66 public void setSleeperRightId(String sleeperRightId) {
67 this.sleeperRightId = sleeperRightId;
70 public Bed withSleeperRightId(String sleeperRightId) {
71 setSleeperRightId(sleeperRightId);
75 public String getBase() {
79 public void setBase(String base) {
83 public Bed withBase(String base) {
88 public Long getReturnRequestStatus() {
89 return returnRequestStatus;
92 public void setReturnRequestStatus(Long returnRequestStatus) {
93 this.returnRequestStatus = returnRequestStatus;
96 public Bed withReturnRequestStatus(Long returnRequestStatus) {
97 setReturnRequestStatus(returnRequestStatus);
101 public String getSize() {
105 public void setSize(String size) {
109 public Bed withSize(String size) {
114 public String getName() {
118 public void setName(String name) {
122 public Bed withName(String name) {
127 public String getSerial() {
131 public void setSerial(String serial) {
132 this.serial = serial;
135 public Bed withSerial(String serial) {
140 public Boolean isKidsBed() {
144 public void setKidsBed(Boolean kidsBed) {
145 this.kidsBed = kidsBed;
148 public Bed withKidsBed(Boolean kidsBed) {
153 public Boolean isDualSleep() {
157 public void setDualSleep(Boolean dualSleep) {
158 this.dualSleep = dualSleep;
161 public Bed withDualSleep(Boolean dualSleep) {
162 setDualSleep(dualSleep);
166 public String getBedId() {
170 public void setBedId(String bedId) {
174 public Bed withBedId(String bedId) {
179 public Long getStatus() {
183 public void setStatus(Long status) {
184 this.status = status;
187 public Bed withStatus(Long status) {
192 public String getSleeperLeftId() {
193 return sleeperLeftId;
196 public void setSleeperLeftId(String sleeperLeftId) {
197 this.sleeperLeftId = sleeperLeftId;
200 public Bed withSleeperLeftId(String sleeperLeftId) {
201 setSleeperLeftId(sleeperLeftId);
205 public String getVersion() {
209 public void setVersion(String version) {
210 this.version = version;
213 public Bed withVersion(String version) {
218 public String getAccountId() {
222 public void setAccountId(String accountId) {
223 this.accountId = accountId;
226 public Bed withAccountId(String accountId) {
227 setAccountId(accountId);
231 public String getTimezone() {
235 public void setTimezone(String timezone) {
236 this.timezone = timezone;
239 public Bed withTimezone(String timezone) {
240 setTimezone(timezone);
244 public String getModel() {
248 public void setModel(String model) {
252 public Bed withModel(String model) {
257 public ZonedDateTime getPurchaseDate() {
261 public void setPurchaseDate(ZonedDateTime purchaseDate) {
262 this.purchaseDate = purchaseDate;
265 public Bed withPurchaseDate(ZonedDateTime purchaseDate) {
266 setPurchaseDate(purchaseDate);
270 public String getMacAddress() {
274 public void setMacAddress(String macAddress) {
275 this.macAddress = macAddress;
278 public Bed withMacAddress(String macAddress) {
279 setMacAddress(macAddress);
283 public String getSku() {
287 public void setSku(String sku) {
291 public Bed withSku(String sku) {
296 public String getZipCode() {
300 public void setZipCode(String zipCode) {
301 this.zipCode = zipCode;
304 public Bed withZipCode(String zipCode) {
309 public String getReference() {
313 public void setReference(String reference) {
314 this.reference = reference;
317 public Bed withReference(String reference) {
318 setReference(reference);
323 public int hashCode() {
324 final int prime = 31;
326 result = prime * result + ((bedId == null) ? 0 : bedId.hashCode());
331 public boolean equals(Object obj) {
338 if (!(obj instanceof Bed)) {
341 Bed other = (Bed) obj;
343 if (other.bedId != null) {
346 } else if (!bedId.equals(other.bedId)) {
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=");
393 builder.append(", zipCode=");
394 builder.append(zipCode);
395 builder.append(", reference=");
396 builder.append(reference);
398 return builder.toString();