Merge "Reorder modifiers"
[so.git] / mso-catalog-db / src / main / java / org / openecomp / mso / db / catalog / beans / ToscaCsar.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.mso.db.catalog.beans;
22
23 import java.io.Serializable;
24 import java.sql.Timestamp;
25 import java.text.DateFormat;
26 import java.util.HashSet;
27 import java.util.Set;
28
29 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
30
31 public class ToscaCsar extends MavenLikeVersioning implements Serializable {
32         
33         private static final long serialVersionUID = 768026109321305392L;
34
35         private String artifactUUID = null;
36         private String name = null;
37         private String artifactChecksum = null;
38         private String url = null;
39         private String description = null;
40         private Timestamp created = null;
41         private Set<Service> services = new HashSet<>();
42         
43         public ToscaCsar() { }
44         
45         public String getArtifactUUID() {
46                 return artifactUUID;
47         }
48         
49         public void setArtifactUUID(String artifactUUID) {
50                 this.artifactUUID = artifactUUID;
51         }
52         
53         public String getName() {
54                 return name;
55         }
56         
57         public void setName(String name) {
58                 this.name = name;
59         }
60         
61         public String getArtifactChecksum() {
62                 return artifactChecksum;
63         }
64         
65         public void setArtifactChecksum(String artifactChecksum) {
66                 this.artifactChecksum = artifactChecksum;
67         }
68         
69         public String getUrl() {
70                 return url;
71         }
72         
73         public void setUrl(String url) {
74                 this.url = url;
75         }
76         
77         public String getDescription() {
78                 return description;
79         }
80         
81         public void setDescription(String description) {
82                 this.description = description;
83         }
84         
85         public Timestamp getCreated() {
86                 return created;
87         }
88         
89         public void setCreated(Timestamp created) {
90                 this.created = created;
91         }
92         
93         public Set<Service> getServices() {
94                 return services;
95         }
96         
97         public void setServices(Set<Service> services) {
98                 this.services = services;
99         }
100         
101         @Override
102         public String toString() {
103                 StringBuilder sb = new StringBuilder();
104                 sb.append("TOSCACSAR: artifactUUID=").append(artifactUUID).append(",name=").append(name).append(",version=")
105             .append(version).append(",description=").append(description).append(",artifactChecksum=")
106             .append(artifactChecksum).append(",url=").append(url);
107                 for (Service service : services) {
108                         sb.append("\n").append(service.toString());
109                 }
110                 if (created != null) {
111                         sb.append (",created=");
112                         sb.append (DateFormat.getInstance().format(created));
113                 }
114                 return sb.toString();
115         }
116 }