2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.mso.asdc.client.test.emulators;
23 import java.util.HashMap;
24 import java.util.List;
27 import org.openecomp.sdc.api.notification.IArtifactInfo;
28 import org.openecomp.sdc.api.notification.IResourceInstance;
30 import com.fasterxml.jackson.annotation.JsonAnySetter;
31 import com.fasterxml.jackson.annotation.JsonIgnore;
32 import com.fasterxml.jackson.annotation.JsonProperty;
33 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
35 public class JsonResourceInfo implements IResourceInstance {
38 private Map<String,Object> attributesMap = new HashMap<>();
40 @JsonProperty("artifacts")
41 @JsonDeserialize(using=JsonArtifactInfoDeserializer.class)
42 private List<IArtifactInfo> artifacts;
44 public JsonResourceInfo() {
49 public List<IArtifactInfo> getArtifacts() {
54 public String getResourceInstanceName() {
55 return (String)attributesMap.get("resourceInstanceName");
59 public String getResourceInvariantUUID() {
60 return (String)attributesMap.get("resourceInvariantUUID");
64 public String getResourceCustomizationUUID() {
65 return (String)attributesMap.get("resourceCustomizationUUID");
69 public String getResourceName() {
70 return (String)attributesMap.get("resourceName");
74 public String getResourceType() {
75 return (String)attributesMap.get("resourceType");
79 public String getResourceUUID() {
80 return (String)attributesMap.get("resourceUUID");
84 public String getResourceVersion() {
85 return (String)attributesMap.get("resourceVersion");
89 public String getSubcategory() {
90 return (String)attributesMap.get("subCategory");
94 public String getCategory() {
95 return (String)attributesMap.get("category");
98 @SuppressWarnings("unused")
100 public final void setAttribute(String attrName, Object attrValue) {
101 if ((null != attrName) && (!attrName.isEmpty()) && (null != attrValue) && (null != attrValue.toString())) {
102 this.attributesMap.put(attrName,attrValue);