diff options
Diffstat (limited to 'common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java')
-rw-r--r-- | common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java index 590cdb8a5a..0061213253 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CompositionDataDefinition.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. @@ -27,34 +27,38 @@ import java.util.HashMap; import java.util.Map; public class CompositionDataDefinition extends ToscaDataDefinition { - - public Map<String, ComponentInstanceDataDefinition> getComponentInstances() { - return (Map<String, ComponentInstanceDataDefinition>) getToscaPresentationValue(JsonPresentationFields.COMPONENT_INSTANCES); - } - public void setComponentInstances(Map<String, ComponentInstanceDataDefinition> componentInstances) { - setToscaPresentationValue(JsonPresentationFields.COMPONENT_INSTANCES, componentInstances); - } - public Map<String, RelationshipInstDataDefinition> getRelations() { - return (Map<String, RelationshipInstDataDefinition>) getToscaPresentationValue(JsonPresentationFields.RELATIONS); - } - public void setRelations(Map<String, RelationshipInstDataDefinition> relations) { - setToscaPresentationValue(JsonPresentationFields.RELATIONS, relations); - } - public void addInstance( String key, ComponentInstanceDataDefinition instance ){ - Map<String, ComponentInstanceDataDefinition> instances = getComponentInstances(); - if (instances == null ){ - instances = new HashMap<>(); - setToscaPresentationValue(JsonPresentationFields.COMPONENT_INSTANCES, instances ); - } - instances.put(key, instance); - } - - public void addRelation( String key, RelationshipInstDataDefinition relation ){ - Map<String, RelationshipInstDataDefinition> relations = getRelations(); - if (relations == null ){ - relations = new HashMap<>(); - setToscaPresentationValue(JsonPresentationFields.RELATIONS, relations ); - } - relations.put(key, relation); - } + + public Map<String, ComponentInstanceDataDefinition> getComponentInstances() { + return (Map<String, ComponentInstanceDataDefinition>) getToscaPresentationValue(JsonPresentationFields.COMPONENT_INSTANCES); + } + + public void setComponentInstances(Map<String, ComponentInstanceDataDefinition> componentInstances) { + setToscaPresentationValue(JsonPresentationFields.COMPONENT_INSTANCES, componentInstances); + } + + public Map<String, RelationshipInstDataDefinition> getRelations() { + return (Map<String, RelationshipInstDataDefinition>) getToscaPresentationValue(JsonPresentationFields.RELATIONS); + } + + public void setRelations(Map<String, RelationshipInstDataDefinition> relations) { + setToscaPresentationValue(JsonPresentationFields.RELATIONS, relations); + } + + public void addInstance(String key, ComponentInstanceDataDefinition instance) { + Map<String, ComponentInstanceDataDefinition> instances = getComponentInstances(); + if (instances == null) { + instances = new HashMap<>(); + setToscaPresentationValue(JsonPresentationFields.COMPONENT_INSTANCES, instances); + } + instances.put(key, instance); + } + + public void addRelation(String key, RelationshipInstDataDefinition relation) { + Map<String, RelationshipInstDataDefinition> relations = getRelations(); + if (relations == null) { + relations = new HashMap<>(); + setToscaPresentationValue(JsonPresentationFields.RELATIONS, relations); + } + relations.put(key, relation); + } } |