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