X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=catalog-be%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fsdc%2Fbe%2Ftosca%2Fmodel%2FToscaNodeTemplate.java;h=eb34732db9f9f602f3c9cd8c0854aee1d8c96933;hb=216ea4998de9ae4ee603d7f8f5f6725b218ca710;hp=b2d7ef5ab6ef60bde0e3ab296776450a009a4ad5;hpb=451a3400b76511393c62a444f588a4ed15f4a549;p=sdc.git diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaNodeTemplate.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaNodeTemplate.java index b2d7ef5ab6..eb34732db9 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaNodeTemplate.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaNodeTemplate.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,57 +17,44 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.tosca.model; +import java.util.HashMap; import java.util.List; import java.util.Map; - +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.MapUtils; + +@Getter +@Setter +@NoArgsConstructor public class ToscaNodeTemplate { - private String type; - private ToscaMetadata metadata; - private Map properties; - private List> requirements; - private Map capabilities; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Map getProperties() { - return properties; - } - - public void setProperties(Map properties) { - this.properties = properties; - } - - public List> getRequirements() { - return requirements; - } - - public void setRequirements(List> requirements) { - this.requirements = requirements; - } - - public Map getCapabilities() { - return capabilities; - } - - public void setCapabilities(Map capabilities) { - this.capabilities = capabilities; - } - - public ToscaMetadata getMetadata() { - return metadata; - } - - public void setMetadata(ToscaMetadata metadata) { - this.metadata = metadata; - } + private String type; + private List occurrences; + private Map instance_count; + private List directives; + private Map metadata; + private String description; + private Map properties; + private Map attributes; + private List> requirements; + private Map capabilities; + private Map artifacts; + private NodeFilter node_filter; + private Map interfaces; + + public void setDirectives(List directives) { + this.directives = CollectionUtils.isEmpty(directives) ? null : directives; + } + + public void addInterface(String interfaceName, Object interfaceDataDefinition) { + if (MapUtils.isEmpty(this.interfaces)) { + this.interfaces = new HashMap<>(); + } + this.interfaces.put(interfaceName, interfaceDataDefinition); + } }