]> git.basschouten.com Git - openhab-addons.git/blob
f526f2a745ff975adfdbf51573bfc0734a891ab2
[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 SleepersResponse} holds the information about the sleepers assigned to the bed sides.
19  *
20  * @author Gregory Moyer - Initial contribution
21  */
22 public class SleepersResponse {
23     private List<Sleeper> sleepers;
24
25     public List<Sleeper> getSleepers() {
26         return sleepers;
27     }
28
29     public void setSleepers(List<Sleeper> sleepers) {
30         this.sleepers = sleepers;
31     }
32
33     public SleepersResponse withSleepers(List<Sleeper> sleepers) {
34         setSleepers(sleepers);
35         return this;
36     }
37
38     @Override
39     public int hashCode() {
40         final int prime = 31;
41         int result = 1;
42         result = prime * result + ((sleepers == null) ? 0 : sleepers.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 SleepersResponse)) {
55             return false;
56         }
57         SleepersResponse other = (SleepersResponse) obj;
58         if (sleepers == null) {
59             if (other.sleepers != null) {
60                 return false;
61             }
62         } else if (!sleepers.equals(other.sleepers)) {
63             return false;
64         }
65         return true;
66     }
67
68     @Override
69     public String toString() {
70         StringBuilder builder = new StringBuilder();
71         builder.append("SleepersResponse [sleepers=");
72         builder.append(sleepers);
73         builder.append("]");
74         return builder.toString();
75     }
76 }