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