]> git.basschouten.com Git - openhab-addons.git/blob
c07fbd8d88ef89075369244751addf5a218a1306
[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 BedStatus
19 {
20     private Long status;
21     private String bedId;
22     private BedSideStatus leftSide;
23     private BedSideStatus rightSide;
24
25     public Long getStatus()
26     {
27         return status;
28     }
29
30     public void setStatus(Long status)
31     {
32         this.status = status;
33     }
34
35     public BedStatus withStatus(Long status)
36     {
37         setStatus(status);
38         return this;
39     }
40
41     public String getBedId()
42     {
43         return bedId;
44     }
45
46     public void setBedId(String bedId)
47     {
48         this.bedId = bedId;
49     }
50
51     public BedStatus withBedId(String bedId)
52     {
53         setBedId(bedId);
54         return this;
55     }
56
57     public BedSideStatus getLeftSide()
58     {
59         return leftSide;
60     }
61
62     public void setLeftSide(BedSideStatus leftSide)
63     {
64         this.leftSide = leftSide;
65     }
66
67     public BedStatus withLeftSide(BedSideStatus leftSide)
68     {
69         setLeftSide(leftSide);
70         return this;
71     }
72
73     public BedSideStatus getRightSide()
74     {
75         return rightSide;
76     }
77
78     public void setRightSide(BedSideStatus rightSide)
79     {
80         this.rightSide = rightSide;
81     }
82
83     public BedStatus withRightSide(BedSideStatus rightSide)
84     {
85         setRightSide(rightSide);
86         return this;
87     }
88
89     @Override
90     public int hashCode()
91     {
92         final int prime = 31;
93         int result = 1;
94         result = prime * result + ((bedId == null) ? 0 : bedId.hashCode());
95         return result;
96     }
97
98     @Override
99     public boolean equals(Object obj)
100     {
101         if (this == obj)
102         {
103             return true;
104         }
105         if (obj == null)
106         {
107             return false;
108         }
109         if (!(obj instanceof BedStatus))
110         {
111             return false;
112         }
113         BedStatus other = (BedStatus)obj;
114         if (bedId == null)
115         {
116             if (other.bedId != null)
117             {
118                 return false;
119             }
120         }
121         else if (!bedId.equals(other.bedId))
122         {
123             return false;
124         }
125         return true;
126     }
127
128     @Override
129     public String toString()
130     {
131         StringBuilder builder = new StringBuilder();
132         builder.append("BedStatus [status=");
133         builder.append(status);
134         builder.append(", bedId=");
135         builder.append(bedId);
136         builder.append(", leftSide=");
137         builder.append(leftSide);
138         builder.append(", rightSide=");
139         builder.append(rightSide);
140         builder.append("]");
141         return builder.toString();
142     }
143 }