]> git.basschouten.com Git - openhab-addons.git/blob
9cdaa4dab7ede79fc576cee34d9a498c76985b49
[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.util.List;
16
17 /**
18  * The {@link BedsResponse} holds the BedsResponse response from the sleepiq API.
19  *
20  * @author Gregory Moyer - Initial contribution
21  */
22 public class BedsResponse {
23     private List<Bed> beds;
24
25     public List<Bed> getBeds() {
26         return beds;
27     }
28
29     public void setBeds(List<Bed> beds) {
30         this.beds = beds;
31     }
32
33     public BedsResponse withBeds(List<Bed> beds) {
34         setBeds(beds);
35         return this;
36     }
37
38     @Override
39     public int hashCode() {
40         final int prime = 31;
41         int result = 1;
42         result = prime * result + ((beds == null) ? 0 : beds.hashCode());
43         return result;
44     }
45
46     @Override
47     public boolean equals(Object obj) {
48         if (this == obj) {
49             return true;
50         }
51         if (obj == null) {
52             return false;
53         }
54         if (!(obj instanceof BedsResponse)) {
55             return false;
56         }
57         BedsResponse other = (BedsResponse) obj;
58         if (beds == null) {
59             if (other.beds != null) {
60                 return false;
61             }
62         } else if (!beds.equals(other.beds)) {
63             return false;
64         }
65         return true;
66     }
67
68     @Override
69     public String toString() {
70         StringBuilder builder = new StringBuilder();
71         builder.append("BedsResponse [beds=");
72         builder.append(beds);
73         builder.append("]");
74         return builder.toString();
75     }
76 }