[PORTAL-16 PORTAL-18] Widget ms; staging
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / ecomp / model / AppCatalogItem.java
1 /*-
2  * ================================================================================
3  * ECOMP Portal
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ================================================================================
19  */
20 package org.openecomp.portalapp.portal.ecomp.model;
21
22 import javax.persistence.Entity;
23 import javax.persistence.Id;
24
25 import org.openecomp.portalsdk.core.domain.support.DomainVo;
26 import com.fasterxml.jackson.annotation.JsonInclude;
27
28 /**
29  * This model of an application catalog entry has some EPApp fields plus
30  * additional fields to indicate access(ible) and select(ed) statuses.
31  */
32 @Entity
33 @JsonInclude(JsonInclude.Include.NON_NULL)
34 public class AppCatalogItem extends DomainVo {
35
36         private static final long serialVersionUID = 6619663784935017846L;
37
38         @Id
39         private Long id;
40         private String name;
41         private String mlAppName;
42         private String imageUrl;
43         private String description;
44         private String notes;
45         private String url;
46         private String alternateUrl;
47         private Boolean restricted;
48         private Boolean open;
49         private Boolean access;
50         private Boolean select;
51         private Boolean pending;
52
53         public Long getId() {
54                 return id;
55         }
56
57         public void setId(Long id) {
58                 this.id = id;
59         }
60
61         public String getName() {
62                 return name;
63         }
64
65         public void setName(String name) {
66                 this.name = name;
67         }
68
69         public String getMlAppName() {
70                 return mlAppName;
71         }
72
73         public void setMlAppName(String mlAppName) {
74                 this.mlAppName = mlAppName;
75         }
76
77         public String getImageUrl() {
78                 return imageUrl;
79         }
80
81         public void setImageUrl(String imageUrl) {
82                 this.imageUrl = imageUrl;
83         }
84
85         public String getDescription() {
86                 return description;
87         }
88
89         public void setDescription(String description) {
90                 this.description = description;
91         }
92
93         public String getNotes() {
94                 return notes;
95         }
96
97         public void setNotes(String notes) {
98                 this.notes = notes;
99         }
100
101         public String getUrl() {
102                 return url;
103         }
104
105         public void setUrl(String url) {
106                 this.url = url;
107         }
108
109         public String getAlternateUrl() {
110                 return alternateUrl;
111         }
112
113         public void setAlternateUrl(String alternateUrl) {
114                 this.alternateUrl = alternateUrl;
115         }
116
117         public Boolean getRestricted() {
118                 return restricted;
119         }
120
121         public void setRestricted(Boolean restricted) {
122                 this.restricted = restricted;
123         }
124
125         public Boolean getOpen() {
126                 return open;
127         }
128
129         public void setOpen(Boolean open) {
130                 this.open = open;
131         }
132
133         public Boolean getAccess() {
134                 return access;
135         }
136
137         public void setAccess(Boolean access) {
138                 this.access = access;
139         }
140
141         public Boolean getSelect() {
142                 return select;
143         }
144
145         public void setSelect(Boolean select) {
146                 this.select = select;
147         }
148
149         public Boolean getPending() {
150                 return pending;
151         }
152
153         public void setPending(Boolean pending) {
154                 this.pending = pending;
155         }
156
157         public static long getSerialversionuid() {
158                 return serialVersionUID;
159         }
160
161         @Override
162         public String toString() {
163                 return "AppCatalogItem [id=" + id + ", name=" + name + ", access=" + access + ", select=" + select
164                                 + ", pending=" + pending + "]";
165         }
166
167         @Override
168         public int hashCode() {
169                 final int prime = 31;
170                 int result = 1;
171                 result = prime * result + ((access == null) ? 0 : access.hashCode());
172                 result = prime * result + ((alternateUrl == null) ? 0 : alternateUrl.hashCode());
173                 result = prime * result + ((description == null) ? 0 : description.hashCode());
174                 result = prime * result + ((id == null) ? 0 : id.hashCode());
175                 result = prime * result + ((imageUrl == null) ? 0 : imageUrl.hashCode());
176                 result = prime * result + ((name == null) ? 0 : name.hashCode());
177                 result = prime * result + ((notes == null) ? 0 : notes.hashCode());
178                 result = prime * result + ((open == null) ? 0 : open.hashCode());
179                 result = prime * result + ((pending == null) ? 0 : pending.hashCode());
180                 result = prime * result + ((restricted == null) ? 0 : restricted.hashCode());
181                 result = prime * result + ((select == null) ? 0 : select.hashCode());
182                 result = prime * result + ((url == null) ? 0 : url.hashCode());
183                 return result;
184         }
185
186         @Override
187         public boolean equals(Object obj) {
188                 if (this == obj)
189                         return true;
190                 if (obj == null)
191                         return false;
192                 if (getClass() != obj.getClass())
193                         return false;
194                 AppCatalogItem other = (AppCatalogItem) obj;
195                 if (access == null) {
196                         if (other.access != null)
197                                 return false;
198                 } else if (!access.equals(other.access))
199                         return false;
200                 if (alternateUrl == null) {
201                         if (other.alternateUrl != null)
202                                 return false;
203                 } else if (!alternateUrl.equals(other.alternateUrl))
204                         return false;
205                 if (description == null) {
206                         if (other.description != null)
207                                 return false;
208                 } else if (!description.equals(other.description))
209                         return false;
210                 if (id == null) {
211                         if (other.id != null)
212                                 return false;
213                 } else if (!id.equals(other.id))
214                         return false;
215                 if (imageUrl == null) {
216                         if (other.imageUrl != null)
217                                 return false;
218                 } else if (!imageUrl.equals(other.imageUrl))
219                         return false;
220                 if (name == null) {
221                         if (other.name != null)
222                                 return false;
223                 } else if (!name.equals(other.name))
224                         return false;
225                 if (notes == null) {
226                         if (other.notes != null)
227                                 return false;
228                 } else if (!notes.equals(other.notes))
229                         return false;
230                 if (open == null) {
231                         if (other.open != null)
232                                 return false;
233                 } else if (!open.equals(other.open))
234                         return false;
235                 if (pending == null) {
236                         if (other.pending != null)
237                                 return false;
238                 } else if (!pending.equals(other.pending))
239                         return false;
240                 if (restricted == null) {
241                         if (other.restricted != null)
242                                 return false;
243                 } else if (!restricted.equals(other.restricted))
244                         return false;
245                 if (select == null) {
246                         if (other.select != null)
247                                 return false;
248                 } else if (!select.equals(other.select))
249                         return false;
250                 if (url == null) {
251                         if (other.url != null)
252                                 return false;
253                 } else if (!url.equals(other.url))
254                         return false;
255                 return true;
256         }
257
258 }