]> git.basschouten.com Git - openhab-addons.git/blob
6a9d04b748f6df2c3f0d4fcf6d9a00448fcb42d0
[openhab-addons.git] /
1 /**
2  * Copyright 2017-2018 Gregory Moyer and contributors.
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.lametrictime.api.local.model;
17
18 public class GoalData
19 {
20     private Integer start;
21     private Integer current;
22     private Integer end;
23     private String unit;
24
25     public Integer getStart()
26     {
27         return start;
28     }
29
30     public void setStart(Integer start)
31     {
32         this.start = start;
33     }
34
35     public GoalData withStart(Integer start)
36     {
37         this.start = start;
38         return this;
39     }
40
41     public Integer getCurrent()
42     {
43         return current;
44     }
45
46     public void setCurrent(Integer current)
47     {
48         this.current = current;
49     }
50
51     public GoalData withCurrent(Integer current)
52     {
53         this.current = current;
54         return this;
55     }
56
57     public Integer getEnd()
58     {
59         return end;
60     }
61
62     public void setEnd(Integer end)
63     {
64         this.end = end;
65     }
66
67     public GoalData withEnd(Integer end)
68     {
69         this.end = end;
70         return this;
71     }
72
73     public String getUnit()
74     {
75         return unit;
76     }
77
78     public void setUnit(String unit)
79     {
80         this.unit = unit;
81     }
82
83     public GoalData withUnit(String unit)
84     {
85         this.unit = unit;
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 + ((current == null) ? 0 : current.hashCode());
95         result = prime * result + ((end == null) ? 0 : end.hashCode());
96         result = prime * result + ((start == null) ? 0 : start.hashCode());
97         result = prime * result + ((unit == null) ? 0 : unit.hashCode());
98         return result;
99     }
100
101     @Override
102     public boolean equals(Object obj)
103     {
104         if (this == obj)
105         {
106             return true;
107         }
108         if (obj == null)
109         {
110             return false;
111         }
112         if (getClass() != obj.getClass())
113         {
114             return false;
115         }
116         GoalData other = (GoalData)obj;
117         if (current == null)
118         {
119             if (other.current != null)
120             {
121                 return false;
122             }
123         }
124         else if (!current.equals(other.current))
125         {
126             return false;
127         }
128         if (end == null)
129         {
130             if (other.end != null)
131             {
132                 return false;
133             }
134         }
135         else if (!end.equals(other.end))
136         {
137             return false;
138         }
139         if (start == null)
140         {
141             if (other.start != null)
142             {
143                 return false;
144             }
145         }
146         else if (!start.equals(other.start))
147         {
148             return false;
149         }
150         if (unit == null)
151         {
152             if (other.unit != null)
153             {
154                 return false;
155             }
156         }
157         else if (!unit.equals(other.unit))
158         {
159             return false;
160         }
161         return true;
162     }
163
164     @Override
165     public String toString()
166     {
167         StringBuilder builder = new StringBuilder();
168         builder.append("GoalData [start=");
169         builder.append(start);
170         builder.append(", current=");
171         builder.append(current);
172         builder.append(", end=");
173         builder.append(end);
174         builder.append(", unit=");
175         builder.append(unit);
176         builder.append("]");
177         return builder.toString();
178     }
179 }