2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
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
26 * https://creativecommons.org/licenses/by/4.0/
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.
34 * ============LICENSE_END============================================
38 package org.onap.portalapp.portal.transport;
40 import java.io.Serializable;
41 import java.util.Date;
43 public class CentralApp implements Serializable {
47 private static final long serialVersionUID = -3325965646585871632L;
50 private Date modified;
51 private Long createdId;
52 private Long modifiedId;
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
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
77 public CentralApp(CentralAppBuilder builder) {
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;
105 public static class CentralAppBuilder {
107 private Date created;
108 private Date modified;
109 private Long createdId;
110 private Long modifiedId;
113 private String imageUrl;
114 private String description;
115 private String notes;
117 private String alternateUrl;
118 private String restEndpoint;
119 private String mlAppName;
120 private String mlAppAdminId;
121 private String motsId;
122 private String appPassword;
124 private String enabled;
125 private byte[] thumbnail;
126 private String username;
127 private String uebKey;
128 private String uebSecret;
129 private String uebTopicName;
131 public CentralAppBuilder setId(Long id) {
136 public CentralAppBuilder setCreated(Date created) {
137 this.created = created;
141 public CentralAppBuilder setModified(Date modified) {
142 this.modified = modified;
146 public CentralAppBuilder setCreatedId(Long createdId) {
147 this.createdId = createdId;
151 public CentralAppBuilder setModifiedId(Long modifiedId) {
152 this.modifiedId = modifiedId;
156 public CentralAppBuilder setRowNum(Long rowNum) {
157 this.rowNum = rowNum;
161 public CentralAppBuilder setName(String name) {
166 public CentralAppBuilder setImageUrl(String imageUrl) {
167 this.imageUrl = imageUrl;
171 public CentralAppBuilder setDescription(String description) {
172 this.description = description;
176 public CentralAppBuilder setNotes(String notes) {
181 public CentralAppBuilder setUrl(String url) {
186 public CentralAppBuilder setAlternateUrl(String alternateUrl) {
187 this.alternateUrl = alternateUrl;
191 public CentralAppBuilder setRestEndpoint(String restEndpoint) {
192 this.restEndpoint = restEndpoint;
196 public CentralAppBuilder setMlAppName(String mlAppName) {
197 this.mlAppName = mlAppName;
201 public CentralAppBuilder setMlAppAdminId(String mlAppAdminId) {
202 this.mlAppAdminId = mlAppAdminId;
206 public CentralAppBuilder setMotsId(String motsId) {
207 this.motsId = motsId;
211 public CentralAppBuilder setAppPassword(String appPassword) {
212 this.appPassword = appPassword;
216 public CentralAppBuilder setOpen(String open) {
221 public CentralAppBuilder setEnabled(String enabled) {
222 this.enabled = enabled;
226 public CentralAppBuilder setThumbnail(byte[] thumbnail) {
227 this.thumbnail = thumbnail;
231 public CentralAppBuilder setUsername(String username) {
232 this.username = username;
236 public CentralAppBuilder setUebKey(String uebKey) {
237 this.uebKey = uebKey;
241 public CentralAppBuilder setUebSecret(String uebSecret) {
242 this.uebSecret = uebSecret;
246 public CentralAppBuilder setUebTopicName(String uebTopicName) {
247 this.uebTopicName = uebTopicName;
251 public CentralApp createCentralApp() {
252 return new CentralApp(this);
256 public Long getId() {
260 public void setId(Long id) {
264 public Date getCreated() {
268 public void setCreated(Date created) {
269 this.created = created;
272 public Date getModified() {
276 public void setModified(Date modified) {
277 this.modified = modified;
280 public Long getCreatedId() {
284 public void setCreatedId(Long createdId) {
285 this.createdId = createdId;
288 public Long getModifiedId() {
292 public void setModifiedId(Long modifiedId) {
293 this.modifiedId = modifiedId;
296 public Long getRowNum() {
300 public void setRowNum(Long rowNum) {
301 this.rowNum = rowNum;
304 public String getName() {
308 public void setName(String name) {
312 public String getImageUrl() {
316 public void setImageUrl(String imageUrl) {
317 this.imageUrl = imageUrl;
320 public String getDescription() {
324 public void setDescription(String description) {
325 this.description = description;
328 public String getNotes() {
332 public void setNotes(String notes) {
336 public String getUrl() {
340 public void setUrl(String url) {
344 public String getAlternateUrl() {
348 public void setAlternateUrl(String alternateUrl) {
349 this.alternateUrl = alternateUrl;
352 public String getRestEndpoint() {
356 public void setRestEndpoint(String restEndpoint) {
357 this.restEndpoint = restEndpoint;
360 public String getMlAppName() {
364 public void setMlAppName(String mlAppName) {
365 this.mlAppName = mlAppName;
368 public String getMlAppAdminId() {
372 public void setMlAppAdminId(String mlAppAdminId) {
373 this.mlAppAdminId = mlAppAdminId;
376 public String getMotsId() {
380 public void setMotsId(String motsId) {
381 this.motsId = motsId;
384 public String getAppPassword() {
388 public void setAppPassword(String appPassword) {
389 this.appPassword = appPassword;
392 public String getOpen() {
396 public void setOpen(String open) {
400 public String getEnabled() {
404 public void setEnabled(String enabled) {
405 this.enabled = enabled;
408 public byte[] getThumbnail() {
412 public void setThumbnail(byte[] thumbnail) {
413 this.thumbnail = thumbnail;
416 public String getUsername() {
420 public void setUsername(String username) {
421 this.username = username;
424 public String getUebKey() {
428 public void setUebKey(String uebKey) {
429 this.uebKey = uebKey;
432 public String getUebSecret() {
436 public void setUebSecret(String uebSecret) {
437 this.uebSecret = uebSecret;
440 public String getUebTopicName() {
444 public void setUebTopicName(String uebTopicName) {
445 this.uebTopicName = uebTopicName;
449 public int hashCode() {
450 final int prime = 31;
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());
477 public boolean equals(Object obj) {
482 if (getClass() != obj.getClass())
484 CentralApp other = (CentralApp) obj;
485 if (alternateUrl == null) {
486 if (other.alternateUrl != null)
488 } else if (!alternateUrl.equals(other.alternateUrl))
490 if (appPassword == null) {
491 if (other.appPassword != null)
493 } else if (!appPassword.equals(other.appPassword))
495 if (createdId == null) {
496 if (other.createdId != null)
498 } else if (!createdId.equals(other.createdId))
500 if (description == null) {
501 if (other.description != null)
503 } else if (!description.equals(other.description))
505 if (enabled == null) {
506 if (other.enabled != null)
508 } else if (!enabled.equals(other.enabled))
511 if (other.id != null)
513 } else if (!id.equals(other.id))
515 if (imageUrl == null) {
516 if (other.imageUrl != null)
518 } else if (!imageUrl.equals(other.imageUrl))
520 if (mlAppAdminId == null) {
521 if (other.mlAppAdminId != null)
523 } else if (!mlAppAdminId.equals(other.mlAppAdminId))
525 if (mlAppName == null) {
526 if (other.mlAppName != null)
528 } else if (!mlAppName.equals(other.mlAppName))
530 if (modifiedId == null) {
531 if (other.modifiedId != null)
533 } else if (!modifiedId.equals(other.modifiedId))
535 if (motsId == null) {
536 if (other.motsId != null)
538 } else if (!motsId.equals(other.motsId))
541 if (other.name != null)
543 } else if (!name.equals(other.name))
546 if (other.notes != null)
548 } else if (!notes.equals(other.notes))
551 if (other.open != null)
553 } else if (!open.equals(other.open))
555 if (restEndpoint == null) {
556 if (other.restEndpoint != null)
558 } else if (!restEndpoint.equals(other.restEndpoint))
560 if (rowNum == null) {
561 if (other.rowNum != null)
563 } else if (!rowNum.equals(other.rowNum))
565 if (uebKey == null) {
566 if (other.uebKey != null)
568 } else if (!uebKey.equals(other.uebKey))
570 if (uebSecret == null) {
571 if (other.uebSecret != null)
573 } else if (!uebSecret.equals(other.uebSecret))
575 if (uebTopicName == null) {
576 if (other.uebTopicName != null)
578 } else if (!uebTopicName.equals(other.uebTopicName))
581 if (other.url != null)
583 } else if (!url.equals(other.url))
585 if (username == null) {
586 if (other.username != null)
588 } else if (!username.equals(other.username))