2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.lametrictime.internal.api.local.dto;
17 import com.google.gson.JsonPrimitive;
18 import com.google.gson.annotations.SerializedName;
23 * @author Gregory Moyer - Initial contribution
27 @SerializedName("package")
28 private String packageName;
29 private Integer index;
30 private Map<String, JsonPrimitive> settings;
32 public String getId() {
36 public void setId(String id) {
40 public Widget withId(String id) {
45 public String getPackageName() {
49 public void setPackageName(String packageName) {
50 this.packageName = packageName;
53 public Widget withPackageName(String packageName) {
54 setPackageName(packageName);
58 public Integer getIndex() {
62 public void setIndex(Integer index) {
66 public Widget withIndex(Integer index) {
71 public Map<String, JsonPrimitive> getSettings() {
75 public void setSettings(Map<String, JsonPrimitive> settings) {
76 this.settings = settings;
79 public Widget withSettings(Map<String, JsonPrimitive> settings) {
80 setSettings(settings);
85 public int hashCode() {
88 result = prime * result + ((id == null) ? 0 : id.hashCode());
89 result = prime * result + ((index == null) ? 0 : index.hashCode());
90 result = prime * result + ((packageName == null) ? 0 : packageName.hashCode());
91 result = prime * result + ((settings == null) ? 0 : settings.hashCode());
96 public boolean equals(Object obj) {
103 if (getClass() != obj.getClass()) {
106 Widget other = (Widget) obj;
108 if (other.id != null) {
111 } else if (!id.equals(other.id)) {
115 if (other.index != null) {
118 } else if (!index.equals(other.index)) {
121 if (packageName == null) {
122 if (other.packageName != null) {
125 } else if (!packageName.equals(other.packageName)) {
128 if (settings == null) {
129 if (other.settings != null) {
132 } else if (!settings.equals(other.settings)) {
139 public String toString() {
140 StringBuilder builder = new StringBuilder();
141 builder.append("Widget [id=");
143 builder.append(", packageName=");
144 builder.append(packageName);
145 builder.append(", index=");
146 builder.append(index);
147 builder.append(", settings=");
148 builder.append(settings);
150 return builder.toString();