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