Reduce number of parameters in constructor
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / transport / CentralApp.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.transport;
39
40 import java.io.Serializable;
41 import java.util.Date;
42
43 public class CentralApp implements Serializable {
44     /**
45      *
46      */
47     private static final long serialVersionUID = -3325965646585871632L;
48     private Long id;
49     private Date created;
50     private Date modified;
51     private Long createdId;
52     private Long modifiedId;
53     private Long rowNum;
54     private String name; // app_name
55     private String imageUrl; // app_image_url
56     private String description; // app_description
57     private String notes; // app_notes
58     private String url; // app_url
59     private String alternateUrl; // app_alternate_url
60     private String restEndpoint; // app_rest_endpoint
61     private String mlAppName; // ml_app_name
62     private String mlAppAdminId; // ml_app_admin_id;
63     private String motsId; // mots_id
64     private String appPassword; // app_password
65     private String open;
66     private String enabled;
67     private byte[] thumbnail;
68     private String username; // app_username
69     private String uebKey; // ueb_key
70     private String uebSecret; // ueb_secret
71     private String uebTopicName; // ueb_topic_name
72
73     public CentralApp() {
74
75     }
76
77     public CentralApp(CentralAppBuilder builder) {
78         super();
79         this.id = builder.id;
80         this.created = builder.created;
81         this.modified = builder.modified;
82         this.createdId = builder.createdId;
83         this.modifiedId = builder.modifiedId;
84         this.rowNum = builder.rowNum;
85         this.name = builder.name;
86         this.imageUrl = builder.imageUrl;
87         this.description = builder.description;
88         this.notes = builder.notes;
89         this.url = builder.url;
90         this.alternateUrl = builder.alternateUrl;
91         this.restEndpoint = builder.restEndpoint;
92         this.mlAppName = builder.mlAppName;
93         this.mlAppAdminId = builder.mlAppAdminId;
94         this.motsId = builder.motsId;
95         this.appPassword = builder.appPassword;
96         this.open = builder.open;
97         this.enabled = builder.enabled;
98         this.thumbnail = builder.thumbnail;
99         this.username = builder.username;
100         this.uebKey = builder.uebKey;
101         this.uebSecret = builder.uebSecret;
102         this.uebTopicName = builder.uebTopicName;
103     }
104
105     public static class CentralAppBuilder {
106         private Long id;
107         private Date created;
108         private Date modified;
109         private Long createdId;
110         private Long modifiedId;
111         private Long rowNum;
112         private String name;
113         private String imageUrl;
114         private String description;
115         private String notes;
116         private String url;
117         private String alternateUrl;
118         private String restEndpoint;
119         private String mlAppName;
120         private String mlAppAdminId;
121         private String motsId;
122         private String appPassword;
123         private String open;
124         private String enabled;
125         private byte[] thumbnail;
126         private String username;
127         private String uebKey;
128         private String uebSecret;
129         private String uebTopicName;
130
131         public CentralAppBuilder setId(Long id) {
132             this.id = id;
133             return this;
134         }
135
136         public CentralAppBuilder setCreated(Date created) {
137             this.created = created;
138             return this;
139         }
140
141         public CentralAppBuilder setModified(Date modified) {
142             this.modified = modified;
143             return this;
144         }
145
146         public CentralAppBuilder setCreatedId(Long createdId) {
147             this.createdId = createdId;
148             return this;
149         }
150
151         public CentralAppBuilder setModifiedId(Long modifiedId) {
152             this.modifiedId = modifiedId;
153             return this;
154         }
155
156         public CentralAppBuilder setRowNum(Long rowNum) {
157             this.rowNum = rowNum;
158             return this;
159         }
160
161         public CentralAppBuilder setName(String name) {
162             this.name = name;
163             return this;
164         }
165
166         public CentralAppBuilder setImageUrl(String imageUrl) {
167             this.imageUrl = imageUrl;
168             return this;
169         }
170
171         public CentralAppBuilder setDescription(String description) {
172             this.description = description;
173             return this;
174         }
175
176         public CentralAppBuilder setNotes(String notes) {
177             this.notes = notes;
178             return this;
179         }
180
181         public CentralAppBuilder setUrl(String url) {
182             this.url = url;
183             return this;
184         }
185
186         public CentralAppBuilder setAlternateUrl(String alternateUrl) {
187             this.alternateUrl = alternateUrl;
188             return this;
189         }
190
191         public CentralAppBuilder setRestEndpoint(String restEndpoint) {
192             this.restEndpoint = restEndpoint;
193             return this;
194         }
195
196         public CentralAppBuilder setMlAppName(String mlAppName) {
197             this.mlAppName = mlAppName;
198             return this;
199         }
200
201         public CentralAppBuilder setMlAppAdminId(String mlAppAdminId) {
202             this.mlAppAdminId = mlAppAdminId;
203             return this;
204         }
205
206         public CentralAppBuilder setMotsId(String motsId) {
207             this.motsId = motsId;
208             return this;
209         }
210
211         public CentralAppBuilder setAppPassword(String appPassword) {
212             this.appPassword = appPassword;
213             return this;
214         }
215
216         public CentralAppBuilder setOpen(String open) {
217             this.open = open;
218             return this;
219         }
220
221         public CentralAppBuilder setEnabled(String enabled) {
222             this.enabled = enabled;
223             return this;
224         }
225
226         public CentralAppBuilder setThumbnail(byte[] thumbnail) {
227             this.thumbnail = thumbnail;
228             return this;
229         }
230
231         public CentralAppBuilder setUsername(String username) {
232             this.username = username;
233             return this;
234         }
235
236         public CentralAppBuilder setUebKey(String uebKey) {
237             this.uebKey = uebKey;
238             return this;
239         }
240
241         public CentralAppBuilder setUebSecret(String uebSecret) {
242             this.uebSecret = uebSecret;
243             return this;
244         }
245
246         public CentralAppBuilder setUebTopicName(String uebTopicName) {
247             this.uebTopicName = uebTopicName;
248             return this;
249         }
250
251         public CentralApp createCentralApp() {
252             return new CentralApp(this);
253         }
254     }
255
256     public Long getId() {
257         return id;
258     }
259
260     public void setId(Long id) {
261         this.id = id;
262     }
263
264     public Date getCreated() {
265         return created;
266     }
267
268     public void setCreated(Date created) {
269         this.created = created;
270     }
271
272     public Date getModified() {
273         return modified;
274     }
275
276     public void setModified(Date modified) {
277         this.modified = modified;
278     }
279
280     public Long getCreatedId() {
281         return createdId;
282     }
283
284     public void setCreatedId(Long createdId) {
285         this.createdId = createdId;
286     }
287
288     public Long getModifiedId() {
289         return modifiedId;
290     }
291
292     public void setModifiedId(Long modifiedId) {
293         this.modifiedId = modifiedId;
294     }
295
296     public Long getRowNum() {
297         return rowNum;
298     }
299
300     public void setRowNum(Long rowNum) {
301         this.rowNum = rowNum;
302     }
303
304     public String getName() {
305         return name;
306     }
307
308     public void setName(String name) {
309         this.name = name;
310     }
311
312     public String getImageUrl() {
313         return imageUrl;
314     }
315
316     public void setImageUrl(String imageUrl) {
317         this.imageUrl = imageUrl;
318     }
319
320     public String getDescription() {
321         return description;
322     }
323
324     public void setDescription(String description) {
325         this.description = description;
326     }
327
328     public String getNotes() {
329         return notes;
330     }
331
332     public void setNotes(String notes) {
333         this.notes = notes;
334     }
335
336     public String getUrl() {
337         return url;
338     }
339
340     public void setUrl(String url) {
341         this.url = url;
342     }
343
344     public String getAlternateUrl() {
345         return alternateUrl;
346     }
347
348     public void setAlternateUrl(String alternateUrl) {
349         this.alternateUrl = alternateUrl;
350     }
351
352     public String getRestEndpoint() {
353         return restEndpoint;
354     }
355
356     public void setRestEndpoint(String restEndpoint) {
357         this.restEndpoint = restEndpoint;
358     }
359
360     public String getMlAppName() {
361         return mlAppName;
362     }
363
364     public void setMlAppName(String mlAppName) {
365         this.mlAppName = mlAppName;
366     }
367
368     public String getMlAppAdminId() {
369         return mlAppAdminId;
370     }
371
372     public void setMlAppAdminId(String mlAppAdminId) {
373         this.mlAppAdminId = mlAppAdminId;
374     }
375
376     public String getMotsId() {
377         return motsId;
378     }
379
380     public void setMotsId(String motsId) {
381         this.motsId = motsId;
382     }
383
384     public String getAppPassword() {
385         return appPassword;
386     }
387
388     public void setAppPassword(String appPassword) {
389         this.appPassword = appPassword;
390     }
391
392     public String getOpen() {
393         return open;
394     }
395
396     public void setOpen(String open) {
397         this.open = open;
398     }
399
400     public String getEnabled() {
401         return enabled;
402     }
403
404     public void setEnabled(String enabled) {
405         this.enabled = enabled;
406     }
407
408     public byte[] getThumbnail() {
409         return thumbnail;
410     }
411
412     public void setThumbnail(byte[] thumbnail) {
413         this.thumbnail = thumbnail;
414     }
415
416     public String getUsername() {
417         return username;
418     }
419
420     public void setUsername(String username) {
421         this.username = username;
422     }
423
424     public String getUebKey() {
425         return uebKey;
426     }
427
428     public void setUebKey(String uebKey) {
429         this.uebKey = uebKey;
430     }
431
432     public String getUebSecret() {
433         return uebSecret;
434     }
435
436     public void setUebSecret(String uebSecret) {
437         this.uebSecret = uebSecret;
438     }
439
440     public String getUebTopicName() {
441         return uebTopicName;
442     }
443
444     public void setUebTopicName(String uebTopicName) {
445         this.uebTopicName = uebTopicName;
446     }
447
448     @Override
449     public int hashCode() {
450         final int prime = 31;
451         int result = 1;
452         result = prime * result + ((alternateUrl == null) ? 0 : alternateUrl.hashCode());
453         result = prime * result + ((appPassword == null) ? 0 : appPassword.hashCode());
454         result = prime * result + ((createdId == null) ? 0 : createdId.hashCode());
455         result = prime * result + ((description == null) ? 0 : description.hashCode());
456         result = prime * result + ((enabled == null) ? 0 : enabled.hashCode());
457         result = prime * result + ((id == null) ? 0 : id.hashCode());
458         result = prime * result + ((imageUrl == null) ? 0 : imageUrl.hashCode());
459         result = prime * result + ((mlAppAdminId == null) ? 0 : mlAppAdminId.hashCode());
460         result = prime * result + ((mlAppName == null) ? 0 : mlAppName.hashCode());
461         result = prime * result + ((modifiedId == null) ? 0 : modifiedId.hashCode());
462         result = prime * result + ((motsId == null) ? 0 : motsId.hashCode());
463         result = prime * result + ((name == null) ? 0 : name.hashCode());
464         result = prime * result + ((notes == null) ? 0 : notes.hashCode());
465         result = prime * result + ((open == null) ? 0 : open.hashCode());
466         result = prime * result + ((restEndpoint == null) ? 0 : restEndpoint.hashCode());
467         result = prime * result + ((rowNum == null) ? 0 : rowNum.hashCode());
468         result = prime * result + ((uebKey == null) ? 0 : uebKey.hashCode());
469         result = prime * result + ((uebSecret == null) ? 0 : uebSecret.hashCode());
470         result = prime * result + ((uebTopicName == null) ? 0 : uebTopicName.hashCode());
471         result = prime * result + ((url == null) ? 0 : url.hashCode());
472         result = prime * result + ((username == null) ? 0 : username.hashCode());
473         return result;
474     }
475
476     @Override
477     public boolean equals(Object obj) {
478         if (this == obj)
479             return true;
480         if (obj == null)
481             return false;
482         if (getClass() != obj.getClass())
483             return false;
484         CentralApp other = (CentralApp) obj;
485         if (alternateUrl == null) {
486             if (other.alternateUrl != null)
487                 return false;
488         } else if (!alternateUrl.equals(other.alternateUrl))
489             return false;
490         if (appPassword == null) {
491             if (other.appPassword != null)
492                 return false;
493         } else if (!appPassword.equals(other.appPassword))
494             return false;
495         if (createdId == null) {
496             if (other.createdId != null)
497                 return false;
498         } else if (!createdId.equals(other.createdId))
499             return false;
500         if (description == null) {
501             if (other.description != null)
502                 return false;
503         } else if (!description.equals(other.description))
504             return false;
505         if (enabled == null) {
506             if (other.enabled != null)
507                 return false;
508         } else if (!enabled.equals(other.enabled))
509             return false;
510         if (id == null) {
511             if (other.id != null)
512                 return false;
513         } else if (!id.equals(other.id))
514             return false;
515         if (imageUrl == null) {
516             if (other.imageUrl != null)
517                 return false;
518         } else if (!imageUrl.equals(other.imageUrl))
519             return false;
520         if (mlAppAdminId == null) {
521             if (other.mlAppAdminId != null)
522                 return false;
523         } else if (!mlAppAdminId.equals(other.mlAppAdminId))
524             return false;
525         if (mlAppName == null) {
526             if (other.mlAppName != null)
527                 return false;
528         } else if (!mlAppName.equals(other.mlAppName))
529             return false;
530         if (modifiedId == null) {
531             if (other.modifiedId != null)
532                 return false;
533         } else if (!modifiedId.equals(other.modifiedId))
534             return false;
535         if (motsId == null) {
536             if (other.motsId != null)
537                 return false;
538         } else if (!motsId.equals(other.motsId))
539             return false;
540         if (name == null) {
541             if (other.name != null)
542                 return false;
543         } else if (!name.equals(other.name))
544             return false;
545         if (notes == null) {
546             if (other.notes != null)
547                 return false;
548         } else if (!notes.equals(other.notes))
549             return false;
550         if (open == null) {
551             if (other.open != null)
552                 return false;
553         } else if (!open.equals(other.open))
554             return false;
555         if (restEndpoint == null) {
556             if (other.restEndpoint != null)
557                 return false;
558         } else if (!restEndpoint.equals(other.restEndpoint))
559             return false;
560         if (rowNum == null) {
561             if (other.rowNum != null)
562                 return false;
563         } else if (!rowNum.equals(other.rowNum))
564             return false;
565         if (uebKey == null) {
566             if (other.uebKey != null)
567                 return false;
568         } else if (!uebKey.equals(other.uebKey))
569             return false;
570         if (uebSecret == null) {
571             if (other.uebSecret != null)
572                 return false;
573         } else if (!uebSecret.equals(other.uebSecret))
574             return false;
575         if (uebTopicName == null) {
576             if (other.uebTopicName != null)
577                 return false;
578         } else if (!uebTopicName.equals(other.uebTopicName))
579             return false;
580         if (url == null) {
581             if (other.url != null)
582                 return false;
583         } else if (!url.equals(other.url))
584             return false;
585         if (username == null) {
586             if (other.username != null)
587                 return false;
588         } else if (!username.equals(other.username))
589             return false;
590         return true;
591     }
592
593 }