Change the header to SO
[so.git] / asdc-controller / src / main / java / org / openecomp / mso / asdc / installer / VfModuleMetaData.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.asdc.installer;
22
23 import java.util.ArrayList;
24 import java.util.HashMap;
25 import java.util.List;
26 import java.util.Map;
27
28 import org.codehaus.jackson.annotate.JsonAnySetter;
29 import org.codehaus.jackson.annotate.JsonIgnore;
30 import org.codehaus.jackson.annotate.JsonProperty;
31
32 import org.openecomp.sdc.api.notification.IVfModuleMetadata;
33
34 public class VfModuleMetaData implements IVfModuleData {
35
36         @JsonProperty("artifacts")
37         private List<String> artifacts;
38
39         @JsonProperty("properties")
40         //private List<Map<String, Object>> properties = new ArrayList<>();
41         private Map<String,String> properties = new HashMap<>();
42
43         @JsonIgnore
44         private Map<String,Object> attributesMap = new HashMap<>();
45
46         @Override
47         public List<String> getArtifacts() {
48                 return artifacts;
49         }
50
51         public Map<String, String> getProperties() {
52                 return properties;
53         }
54
55         @Override
56         public String getVfModuleModelDescription() {
57                 return (String)attributesMap.get("vfModuleModelDescription");
58         }
59
60         @Override
61         public String getVfModuleModelInvariantUUID() {
62                 return (String)attributesMap.get("vfModuleModelInvariantUUID");
63         }
64
65         public String getVfModuleModelCustomizationUUID() {
66                 return (String)attributesMap.get("vfModuleModelCustomizationUUID");
67         }
68
69         @Override
70         public String getVfModuleModelName() {
71                 return (String)attributesMap.get("vfModuleModelName");
72         }
73
74         @Override
75         public String getVfModuleModelUUID() {
76                 return (String)attributesMap.get("vfModuleModelUUID");
77         }
78
79         @Override
80         public String getVfModuleModelVersion() {
81                 return (String)attributesMap.get("vfModuleModelVersion");
82         }
83
84         @Override
85         public boolean isBase() {
86                 return (boolean)attributesMap.get("isBase");
87         }
88
89
90
91         @SuppressWarnings("unused")
92         @JsonAnySetter
93         public final void setAttribute(String attrName, Object attrValue) {
94                 if ((null != attrName) && (!attrName.isEmpty()) && (null != attrValue) && (null != attrValue.toString())) {
95                         this.attributesMap.put(attrName,attrValue);
96                 }
97         }
98
99 }