Merge "Reorder modifiers"
[so.git] / adapters / mso-adapter-utils / src / main / java / org / openecomp / mso / adapters / vdu / VduArtifact.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP - SO\r
4  * ================================================================================\r
5  * Copyright (C) 2018 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.mso.adapters.vdu;\r
22 \r
23 import java.util.Arrays;\r
24 import java.util.Objects;\r
25 \r
26 public class VduArtifact {\r
27         \r
28         // Enumerate the types of artifacts permitted.  This may need to be a variable string\r
29         // value if arbitrary (cloud-specific) artifacts may be attached to VDUs in ASDC.\r
30         public enum ArtifactType {\r
31                 MAIN_TEMPLATE, NESTED_TEMPLATE, CONFIG_FILE, SCRIPT_FILE, TEXT_FILE, ENVIRONMENT\r
32         }\r
33         \r
34         private String name;\r
35         private byte[] content;\r
36         private ArtifactType type;\r
37         \r
38         // Default constructor\r
39         public VduArtifact() {}\r
40         \r
41         // Fully specified constructor\r
42         public VduArtifact (String name, byte[] content, ArtifactType type) {\r
43                 this.name = name;\r
44                 this.content = content;\r
45                 this.type = type;\r
46         }\r
47         \r
48         public String getName() {\r
49                 return name;\r
50         }\r
51         public void setName (String name) {\r
52                 this.name = name;\r
53         }\r
54         public byte[] getContent() {\r
55                 return content;\r
56         }\r
57         public void setContent(byte[] content) {\r
58                 this.content = content;\r
59         }\r
60         public ArtifactType getType() {\r
61                 return type;\r
62         }\r
63         public void setType(ArtifactType type) {\r
64                 this.type = type;\r
65         }\r
66 \r
67         @Override\r
68         public boolean equals(Object o) {\r
69                 if (this == o) {\r
70                         return true;\r
71                 }\r
72                 if (o == null || getClass() != o.getClass()) {\r
73                         return false;\r
74                 }\r
75                 VduArtifact that = (VduArtifact) o;\r
76                 return Objects.equals(name, that.name) &&\r
77                                 Arrays.equals(content, that.content) &&\r
78                                 type == that.type;\r
79         }\r
80 }