]> git.basschouten.com Git - openhab-addons.git/blob
c5b4a4fed9852298eddb07aa12ef60848a33e85d
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.lametrictime.internal.api.local.dto;
14
15 import java.util.SortedMap;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * Pojo for application.
21  *
22  * @author Gregory Moyer - Initial contribution
23  */
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;
32
33     public SortedMap<String, Action> getActions() {
34         return actions;
35     }
36
37     public void setActions(SortedMap<String, Action> actions) {
38         this.actions = actions;
39     }
40
41     public Application withActions(SortedMap<String, Action> actions) {
42         setActions(actions);
43         return this;
44     }
45
46     public String getPackageName() {
47         return packageName;
48     }
49
50     public void setPackageName(String packageName) {
51         this.packageName = packageName;
52     }
53
54     public Application withPackageName(String packageName) {
55         setPackageName(packageName);
56         return this;
57     }
58
59     public String getVendor() {
60         return vendor;
61     }
62
63     public void setVendor(String vendor) {
64         this.vendor = vendor;
65     }
66
67     public Application withVendor(String vendor) {
68         setVendor(vendor);
69         return this;
70     }
71
72     public String getVersion() {
73         return version;
74     }
75
76     public void setVersion(String version) {
77         this.version = version;
78     }
79
80     public Application withVersion(String version) {
81         setVersion(version);
82         return this;
83     }
84
85     public String getVersionCode() {
86         return versionCode;
87     }
88
89     public void setVersionCode(String versionCode) {
90         this.versionCode = versionCode;
91     }
92
93     public Application withVersionCode(String versionCode) {
94         setVersionCode(versionCode);
95         return this;
96     }
97
98     public SortedMap<String, Widget> getWidgets() {
99         return widgets;
100     }
101
102     public void setWidgets(SortedMap<String, Widget> widgets) {
103         this.widgets = widgets;
104     }
105
106     public Application withWidgets(SortedMap<String, Widget> widgets) {
107         setWidgets(widgets);
108         return this;
109     }
110
111     @Override
112     public int hashCode() {
113         final int prime = 31;
114         int result = 1;
115         result = prime * result + ((packageName == null) ? 0 : packageName.hashCode());
116         result = prime * result + ((versionCode == null) ? 0 : versionCode.hashCode());
117         return result;
118     }
119
120     @Override
121     public boolean equals(Object obj) {
122         if (this == obj) {
123             return true;
124         }
125         if (obj == null) {
126             return false;
127         }
128         if (getClass() != obj.getClass()) {
129             return false;
130         }
131         Application other = (Application) obj;
132         if (packageName == null) {
133             if (other.packageName != null) {
134                 return false;
135             }
136         } else if (!packageName.equals(other.packageName)) {
137             return false;
138         }
139         if (versionCode == null) {
140             if (other.versionCode != null) {
141                 return false;
142             }
143         } else if (!versionCode.equals(other.versionCode)) {
144             return false;
145         }
146         return true;
147     }
148
149     @Override
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);
164         builder.append("]");
165         return builder.toString();
166     }
167 }