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;
20 import com.google.gson.JsonPrimitive;
21 import com.google.gson.annotations.SerializedName;
26 @SerializedName("package")
27 private String packageName;
28 private Integer index;
29 private Map<String, JsonPrimitive> settings;
36 public void setId(String id)
41 public Widget withId(String id)
47 public String getPackageName()
52 public void setPackageName(String packageName)
54 this.packageName = packageName;
57 public Widget withPackageName(String packageName)
59 setPackageName(packageName);
63 public Integer getIndex()
68 public void setIndex(Integer index)
73 public Widget withIndex(Integer index)
79 public Map<String, JsonPrimitive> getSettings()
84 public void setSettings(Map<String, JsonPrimitive> settings)
86 this.settings = settings;
89 public Widget withSettings(Map<String, JsonPrimitive> settings)
91 setSettings(settings);
100 result = prime * result + ((id == null) ? 0 : id.hashCode());
101 result = prime * result + ((index == null) ? 0 : index.hashCode());
102 result = prime * result + ((packageName == null) ? 0 : packageName.hashCode());
103 result = prime * result + ((settings == null) ? 0 : settings.hashCode());
108 public boolean equals(Object obj)
118 if (getClass() != obj.getClass())
122 Widget other = (Widget)obj;
125 if (other.id != null)
130 else if (!id.equals(other.id))
136 if (other.index != null)
141 else if (!index.equals(other.index))
145 if (packageName == null)
147 if (other.packageName != null)
152 else if (!packageName.equals(other.packageName))
156 if (settings == null)
158 if (other.settings != null)
163 else if (!settings.equals(other.settings))
171 public String toString()
173 StringBuilder builder = new StringBuilder();
174 builder.append("Widget [id=");
176 builder.append(", packageName=");
177 builder.append(packageName);
178 builder.append(", index=");
179 builder.append(index);
180 builder.append(", settings=");
181 builder.append(settings);
183 return builder.toString();