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;
15 import java.util.SortedMap;
17 import com.google.gson.annotations.SerializedName;
20 * Pojo for application.
22 * @author Gregory Moyer - Initial contribution
24 public class Application {
25 private SortedMap<String, Action> actions;
26 @SerializedName("package")
27 private String packageName;
28 private String vendor;
29 private String version;
30 private String versionCode;
31 private SortedMap<String, Widget> widgets;
33 public SortedMap<String, Action> getActions() {
37 public void setActions(SortedMap<String, Action> actions) {
38 this.actions = actions;
41 public Application withActions(SortedMap<String, Action> actions) {
46 public String getPackageName() {
50 public void setPackageName(String packageName) {
51 this.packageName = packageName;
54 public Application withPackageName(String packageName) {
55 setPackageName(packageName);
59 public String getVendor() {
63 public void setVendor(String vendor) {
67 public Application withVendor(String vendor) {
72 public String getVersion() {
76 public void setVersion(String version) {
77 this.version = version;
80 public Application withVersion(String version) {
85 public String getVersionCode() {
89 public void setVersionCode(String versionCode) {
90 this.versionCode = versionCode;
93 public Application withVersionCode(String versionCode) {
94 setVersionCode(versionCode);
98 public SortedMap<String, Widget> getWidgets() {
102 public void setWidgets(SortedMap<String, Widget> widgets) {
103 this.widgets = widgets;
106 public Application withWidgets(SortedMap<String, Widget> widgets) {
112 public int hashCode() {
113 final int prime = 31;
115 result = prime * result + ((packageName == null) ? 0 : packageName.hashCode());
116 result = prime * result + ((versionCode == null) ? 0 : versionCode.hashCode());
121 public boolean equals(Object obj) {
128 if (getClass() != obj.getClass()) {
131 Application other = (Application) obj;
132 if (packageName == null) {
133 if (other.packageName != null) {
136 } else if (!packageName.equals(other.packageName)) {
139 if (versionCode == null) {
140 if (other.versionCode != null) {
143 } else if (!versionCode.equals(other.versionCode)) {
150 public String toString() {
151 StringBuilder builder = new StringBuilder();
152 builder.append("Application [actions=");
153 builder.append(actions);
154 builder.append(", packageName=");
155 builder.append(packageName);
156 builder.append(", vendor=");
157 builder.append(vendor);
158 builder.append(", version=");
159 builder.append(version);
160 builder.append(", versionCode=");
161 builder.append(versionCode);
162 builder.append(", widgets=");
163 builder.append(widgets);
165 return builder.toString();