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