Upgrade sonar plugin
[vid.git] / vid-app-common / src / main / java / org / openecomp / vid / asdc / beans / Artifact.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * VID\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\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  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 package org.openecomp.vid.asdc.beans;\r
22 \r
23 import java.util.UUID;\r
24 \r
25 /**\r
26  * The Class Artifact.\r
27  */\r
28 public class Artifact {\r
29 \r
30 /*\r
31  * SDC has widened this to a String type for 1610.\r
32         public enum Type {\r
33                 HEAT,\r
34                 HEAT_ENV,\r
35                 HEAT_VOL,\r
36                 HEAT_NET,\r
37                 HEAT_NESTED,\r
38                 HEAT_ARTIFACT,\r
39                 YANG_XML,\r
40                 VNF_CATALOG,\r
41                 VF_LICENSE,\r
42                 VENDOR_LICENSE,\r
43                 ASSET_INVENTORY_PROFILE,\r
44                 ASSET_QUERY_SPEC,\r
45                 APPC_CONFIG,\r
46                 VF_MODULES_METADATA,\r
47                 DCAE_TOSCA,\r
48                 DCAE_JSON,\r
49                 DCAE_EMF,\r
50                 DCAE_DOC,\r
51                 DCAE_BLUEPRINT,\r
52                 DCAE_EVENT,\r
53                 DCAE_INVENTORY_TOSCA,\r
54                 DCAE_INVENTORY_JSON,\r
55                 DCAE_INVENTORY_EMF,\r
56                 DCAE_INVENTORY_DOC,\r
57                 DCAE_INVENTORY_BLUEPRINT,\r
58                 DCAE_INVENTORY_EVENT,\r
59                 OTHER,\r
60                 AAI_SERVICE_MODEL //HEY! READ ME! YES, YOU!  I AM A TEMPORARY FIX, PLEASE REMOVE ME BECAUSE I AM A FRAUD.  I DON'T BELONG HERE.\r
61                                                   //Warm Regards,\r
62                                                   //    *The* Artifact.Type.AAI_SERVICE_MODEL Constant\r
63         }\r
64         */\r
65         \r
66         /** The artifact name. */\r
67         private String artifactName;\r
68         \r
69         /** The artifact label. */\r
70         private String artifactLabel;\r
71         \r
72         /** The artifact group type. */\r
73         private String artifactGroupType;\r
74         \r
75         /** The artifact type. */\r
76         private String artifactType;\r
77         \r
78         /** The artifact URL. */\r
79         private String artifactURL;\r
80         \r
81         /** The artifact description. */\r
82         private String artifactDescription;\r
83         \r
84         /** The artifact timeout. */\r
85         private int artifactTimeout;\r
86         \r
87         /** The artifact checksum. */\r
88         private String artifactChecksum;\r
89         \r
90         /** The artifact UUID. */\r
91         private String artifactUUID;\r
92         \r
93         /** The artifact version. */\r
94         private String artifactVersion;\r
95         \r
96         /** The generated from UUID. */\r
97         private String generatedFromUUID;\r
98         \r
99         /**\r
100          * Gets the artifact name.\r
101          *\r
102          * @return the artifact name\r
103          */\r
104         public String getArtifactName() {\r
105                 return artifactName;\r
106         }\r
107         \r
108         /**\r
109          * Gets the artifact type.\r
110          *\r
111          * @return the artifact type\r
112          */\r
113         public String getArtifactType() {\r
114                 return artifactType;\r
115         }\r
116         /**\r
117          * Gets the artifact group type.\r
118          *\r
119          * @return the artifact group type\r
120          */\r
121         public String getArtifactGroupType() {\r
122                 return artifactGroupType;\r
123         }\r
124         \r
125         /**\r
126          * Gets the artifact label.\r
127          *\r
128          * @return the artifact label\r
129          */\r
130         public String getArtifactLabel() {\r
131                 return artifactLabel;\r
132         }\r
133         /**\r
134          * Gets the artifact URL.\r
135          *\r
136          * @return the artifact URL\r
137          */\r
138         public String getArtifactURL() {\r
139                 return artifactURL;\r
140         }\r
141         \r
142         /**\r
143          * Gets the artifact description.\r
144          *\r
145          * @return the artifact description\r
146          */\r
147         public String getArtifactDescription() {\r
148                 return artifactDescription;\r
149         }\r
150         \r
151         /**\r
152          * Gets the artifact timeout.\r
153          *\r
154          * @return the artifact timeout\r
155          */\r
156         public int getArtifactTimeout() {\r
157                 return artifactTimeout;\r
158         }\r
159         \r
160         /**\r
161          * Gets the artifact checksum.\r
162          *\r
163          * @return the artifact checksum\r
164          */\r
165         public String getArtifactChecksum() {\r
166                 return artifactChecksum;\r
167         }\r
168         \r
169         /**\r
170          * Gets the artifact UUID.\r
171          *\r
172          * @return the artifact UUID\r
173          */\r
174         public String getArtifactUUID() {\r
175                 return artifactUUID;\r
176         }\r
177         \r
178         /**\r
179          * Gets the artifact version.\r
180          *\r
181          * @return the artifact version\r
182          */\r
183         public String getArtifactVersion() {\r
184                 return artifactVersion;\r
185         }\r
186         \r
187         /**\r
188          * Gets the generated from UUID.\r
189          *\r
190          * @return the generated from UUID\r
191          */\r
192         public String getGeneratedFromUUID() {\r
193                 return generatedFromUUID;\r
194         }\r
195         \r
196         /**\r
197          * Sets the artifact name.\r
198          *\r
199          * @param artifactName the new artifact name\r
200          */\r
201         public void setArtifactName(String artifactName) {\r
202                 this.artifactName = artifactName;\r
203         }\r
204         \r
205         /**\r
206          * Sets the artifact type.\r
207          *\r
208          * @param artifactType the new artifact type\r
209          */\r
210         public void setArtifactType(String artifactType) {\r
211                 this.artifactType = artifactType;\r
212         }\r
213         /**\r
214          * Sets the artifact group type.\r
215          *\r
216          * @param artifactGroupType the new artifact group type\r
217          */\r
218         public void setArtifactGroupType(String artifactGroupType) {\r
219                 this.artifactGroupType = artifactGroupType;\r
220         }\r
221         /**\r
222          * Sets the artifact label.\r
223          *\r
224          * @param artifactGroupType the new artifact label\r
225          */\r
226         public void setArtifactLabel(String artifactLabel) {\r
227                 this.artifactLabel = artifactLabel;\r
228         }\r
229         /**\r
230          * Sets the artifact URL.\r
231          *\r
232          * @param artifactURL the new artifact URL\r
233          */\r
234         public void setArtifactURL(String artifactURL) {\r
235                 this.artifactURL = artifactURL;\r
236         }\r
237         \r
238         /**\r
239          * Sets the artifact description.\r
240          *\r
241          * @param artifactDescription the new artifact description\r
242          */\r
243         public void setArtifactDescription(String artifactDescription) {\r
244                 this.artifactDescription = artifactDescription;\r
245         }\r
246         \r
247         /**\r
248          * Sets the artifact timeout.\r
249          *\r
250          * @param artifactTimeout the new artifact timeout\r
251          */\r
252         public void setArtifactTimeout(int artifactTimeout) {\r
253                 this.artifactTimeout = artifactTimeout;\r
254         }\r
255         \r
256         /**\r
257          * Sets the artifact checksum.\r
258          *\r
259          * @param artifactChecksum the new artifact checksum\r
260          */\r
261         public void setArtifactChecksum(String artifactChecksum) {\r
262                 this.artifactChecksum = artifactChecksum;\r
263         }\r
264         \r
265         /**\r
266          * Sets the artifact UUID.\r
267          *\r
268          * @param artifactUUID the new artifact UUID\r
269          */\r
270         public void setArtifactUUID(String artifactUUID) {\r
271                 this.artifactUUID = artifactUUID;\r
272         }\r
273         \r
274         /**\r
275          * Sets the artifact version.\r
276          *\r
277          * @param artifactVersion the new artifact version\r
278          */\r
279         public void setArtifactVersion(String artifactVersion) {\r
280                 this.artifactVersion = artifactVersion;\r
281         }\r
282         \r
283         /**\r
284          * Sets the generated from UUID.\r
285          *\r
286          * @param generatedFromUUID the new generated from UUID\r
287          */\r
288         public void setGeneratedFromUUID(String generatedFromUUID) {\r
289                 this.generatedFromUUID = generatedFromUUID;\r
290         }\r
291         \r
292         /* (non-Javadoc)\r
293          * @see java.lang.Object#hashCode()\r
294          */\r
295         @Override\r
296         public int hashCode() {\r
297                 final UUID uuid = UUID.fromString(getArtifactUUID());\r
298                 \r
299                 return uuid.hashCode();\r
300         }\r
301         \r
302         /* (non-Javadoc)\r
303          * @see java.lang.Object#equals(java.lang.Object)\r
304          */\r
305         @Override\r
306         public boolean equals(Object o) {\r
307                 if (o == this) return true;\r
308                 if (!(o instanceof Artifact)) return false;\r
309                 \r
310                 final Artifact artifact = (Artifact) o;\r
311                 \r
312                 return (artifact.getArtifactUUID().equals(getArtifactUUID()));\r
313         }\r
314 }\r