2 * Copyright 2017-2018 Gregory Moyer and contributors.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.openhab.binding.lametrictime.api.local.model;
18 import java.util.SortedMap;
20 import com.google.gson.annotations.SerializedName;
22 public class Application
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;
32 public SortedMap<String, Action> getActions()
37 public void setActions(SortedMap<String, Action> actions)
39 this.actions = actions;
42 public Application withActions(SortedMap<String, Action> actions)
48 public String getPackageName()
53 public void setPackageName(String packageName)
55 this.packageName = packageName;
58 public Application withPackageName(String packageName)
60 setPackageName(packageName);
64 public String getVendor()
69 public void setVendor(String vendor)
74 public Application withVendor(String vendor)
80 public String getVersion()
85 public void setVersion(String version)
87 this.version = version;
90 public Application withVersion(String version)
96 public String getVersionCode()
101 public void setVersionCode(String versionCode)
103 this.versionCode = versionCode;
106 public Application withVersionCode(String versionCode)
108 setVersionCode(versionCode);
112 public SortedMap<String, Widget> getWidgets()
117 public void setWidgets(SortedMap<String, Widget> widgets)
119 this.widgets = widgets;
122 public Application withWidgets(SortedMap<String, Widget> widgets)
129 public int hashCode()
131 final int prime = 31;
133 result = prime * result + ((packageName == null) ? 0 : packageName.hashCode());
134 result = prime * result + ((versionCode == null) ? 0 : versionCode.hashCode());
139 public boolean equals(Object obj)
149 if (getClass() != obj.getClass())
153 Application other = (Application)obj;
154 if (packageName == null)
156 if (other.packageName != null)
161 else if (!packageName.equals(other.packageName))
165 if (versionCode == null)
167 if (other.versionCode != null)
172 else if (!versionCode.equals(other.versionCode))
180 public String toString()
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);
196 return builder.toString();