]> git.basschouten.com Git - openhab-addons.git/blob
487a9ff6158a4caa3d9b4cb83c85a20664ab3c97
[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 import java.util.SortedMap;
19
20 import com.google.gson.annotations.SerializedName;
21
22 public class Application
23 {
24     private SortedMap<String, Action> actions;
25     @SerializedName("package")
26     private String packageName;
27     private String vendor;
28     private String version;
29     private String versionCode;
30     private SortedMap<String, Widget> widgets;
31
32     public SortedMap<String, Action> getActions()
33     {
34         return actions;
35     }
36
37     public void setActions(SortedMap<String, Action> actions)
38     {
39         this.actions = actions;
40     }
41
42     public Application withActions(SortedMap<String, Action> actions)
43     {
44         setActions(actions);
45         return this;
46     }
47
48     public String getPackageName()
49     {
50         return packageName;
51     }
52
53     public void setPackageName(String packageName)
54     {
55         this.packageName = packageName;
56     }
57
58     public Application withPackageName(String packageName)
59     {
60         setPackageName(packageName);
61         return this;
62     }
63
64     public String getVendor()
65     {
66         return vendor;
67     }
68
69     public void setVendor(String vendor)
70     {
71         this.vendor = vendor;
72     }
73
74     public Application withVendor(String vendor)
75     {
76         setVendor(vendor);
77         return this;
78     }
79
80     public String getVersion()
81     {
82         return version;
83     }
84
85     public void setVersion(String version)
86     {
87         this.version = version;
88     }
89
90     public Application withVersion(String version)
91     {
92         setVersion(version);
93         return this;
94     }
95
96     public String getVersionCode()
97     {
98         return versionCode;
99     }
100
101     public void setVersionCode(String versionCode)
102     {
103         this.versionCode = versionCode;
104     }
105
106     public Application withVersionCode(String versionCode)
107     {
108         setVersionCode(versionCode);
109         return this;
110     }
111
112     public SortedMap<String, Widget> getWidgets()
113     {
114         return widgets;
115     }
116
117     public void setWidgets(SortedMap<String, Widget> widgets)
118     {
119         this.widgets = widgets;
120     }
121
122     public Application withWidgets(SortedMap<String, Widget> widgets)
123     {
124         setWidgets(widgets);
125         return this;
126     }
127
128     @Override
129     public int hashCode()
130     {
131         final int prime = 31;
132         int result = 1;
133         result = prime * result + ((packageName == null) ? 0 : packageName.hashCode());
134         result = prime * result + ((versionCode == null) ? 0 : versionCode.hashCode());
135         return result;
136     }
137
138     @Override
139     public boolean equals(Object obj)
140     {
141         if (this == obj)
142         {
143             return true;
144         }
145         if (obj == null)
146         {
147             return false;
148         }
149         if (getClass() != obj.getClass())
150         {
151             return false;
152         }
153         Application other = (Application)obj;
154         if (packageName == null)
155         {
156             if (other.packageName != null)
157             {
158                 return false;
159             }
160         }
161         else if (!packageName.equals(other.packageName))
162         {
163             return false;
164         }
165         if (versionCode == null)
166         {
167             if (other.versionCode != null)
168             {
169                 return false;
170             }
171         }
172         else if (!versionCode.equals(other.versionCode))
173         {
174             return false;
175         }
176         return true;
177     }
178
179     @Override
180     public String toString()
181     {
182         StringBuilder builder = new StringBuilder();
183         builder.append("Application [actions=");
184         builder.append(actions);
185         builder.append(", packageName=");
186         builder.append(packageName);
187         builder.append(", vendor=");
188         builder.append(vendor);
189         builder.append(", version=");
190         builder.append(version);
191         builder.append(", versionCode=");
192         builder.append(versionCode);
193         builder.append(", widgets=");
194         builder.append(widgets);
195         builder.append("]");
196         return builder.toString();
197     }
198 }