diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-01-10 12:42:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-01-10 12:42:59 +0000 |
commit | 659874df80409170e57b6dd6197eb3a81eb3468e (patch) | |
tree | 08e79fd57aa0ed299586fd88f69f87a5a2f5ded1 /vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca | |
parent | 143784a849ece4fc35cc290e33f829b72bf1fc79 (diff) | |
parent | 6ad41e3ccd398a2721f41ad61c80b7bb03f7d127 (diff) |
Merge "Merge from ECOMP's repository"
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca')
8 files changed, 26 insertions, 23 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java index 590284928..d66591c3b 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java @@ -20,10 +20,11 @@ package org.onap.vid.asdc.beans.tosca; +import com.fasterxml.jackson.annotation.JsonInclude; import org.onap.sdc.toscaparser.api.Property; -import java.util.List; import java.util.ArrayList; +import java.util.List; // TODO: Auto-generated Javadoc /** @@ -36,6 +37,7 @@ public class Input { this.description = input.getDescription(); this._default = input.getDefault(); this.inputProperties = new InputProperties(properties); + this.fromInputName = input.getName(); } /** The type. */ @@ -51,7 +53,9 @@ public class Input { private Input entry_schema; private InputProperties inputProperties; - + + private String fromInputName; + /** The constraints */ private List<org.onap.sdc.toscaparser.api.elements.constraints.Constraint> constraints; @@ -63,12 +67,12 @@ public class Input { private String templateUUID; private String templateInvariantUUID; private String templateCustomizationUUID; - + /** * Instantiates a new input. */ public Input() { - constraints = new ArrayList<org.onap.sdc.toscaparser.api.elements.constraints.Constraint>(); + constraints = new ArrayList<>(); } /** @@ -160,6 +164,11 @@ public class Input { return inputProperties; } + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getFromInputName() { + return fromInputName; + } + public void setInputProperties(InputProperties inputProperties) { this.inputProperties = inputProperties; } diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/InputProperties.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/InputProperties.java index bc2513ea9..c5fe8b90e 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/InputProperties.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/InputProperties.java @@ -17,13 +17,10 @@ public class InputProperties { for(Property property: properties) { if (property.getName().equals("source_type")) { this.sourceType = (String)property.getValue(); - continue; } else if (property.getName().equals("param_name")) { this.paramName = (String)property.getValue(); - continue; } else if (property.getName().equals("vf_module_label")) { this.vfModuleLabel = getPropertyValueAsString(property); - continue; } } } diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java index 28210b2ec..23c0a1094 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java @@ -20,8 +20,8 @@ package org.onap.vid.asdc.beans.tosca; -import java.util.Map; import java.util.HashMap; +import java.util.Map; /** * The Class NodeTemplate. @@ -41,7 +41,7 @@ public class NodeTemplate { private Object requirements; public NodeTemplate () { - properties = new HashMap<String,Object>(); + properties = new HashMap<>(); } /** * Gets the type. diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java index 74b00bdf7..a15c55ff5 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java @@ -43,7 +43,7 @@ public class Property { /** * Instantiates a new property. */ - Property() {} + private Property() {} /** * Gets the type. diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java index 70779c5f2..4ce30239c 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java @@ -41,8 +41,8 @@ public class SubstitutionMappings { * Instantiates a new substitution mappings. */ public SubstitutionMappings() { - capabilities = new HashMap<String, Object> (); - requirements = new HashMap<String, Object> (); + capabilities = new HashMap<> (); + requirements = new HashMap<> (); } /** diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java index 70830715e..b24627d1f 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java @@ -45,9 +45,9 @@ public class TopologyTemplate { */ public TopologyTemplate() { substitution_mappings = new SubstitutionMappings(); - inputs = new HashMap<String, Input> (); - node_templates = new HashMap<String, NodeTemplate> (); - groups = new HashMap<String, Group> (); + inputs = new HashMap<> (); + node_templates = new HashMap<> (); + groups = new HashMap<> (); } /** diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java index 678583573..4cf2f7975 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java @@ -43,7 +43,7 @@ public class ToscaCsar { private final ToscaModel parent; /** The children. */ - private Collection<ToscaModel> children = new LinkedList<ToscaModel> (); + private Collection<ToscaModel> children = new LinkedList<> (); /** * Instantiates a new builder. diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java index a7a6c6296..ad8834015 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java @@ -20,6 +20,8 @@ package org.onap.vid.asdc.beans.tosca; +import org.onap.vid.asdc.AsdcCatalogException; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -27,8 +29,6 @@ import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; -import org.onap.vid.asdc.AsdcCatalogException; - /** * The Class ToscaMeta. */ @@ -45,7 +45,7 @@ public class ToscaMeta { * @throws AsdcCatalogException the asdc catalog exception */ private ToscaMeta(Builder builder) throws IOException, AsdcCatalogException { - metadata = new HashMap<String, String> (); + metadata = new HashMap<> (); read(builder.inputStream); } @@ -113,10 +113,7 @@ public class ToscaMeta { metadata.put(entry[0], entry[1].substring(1)); } } - } catch (IOException e) { - metadata.clear(); - throw e; - } catch (AsdcCatalogException e) { + } catch (IOException | AsdcCatalogException e) { metadata.clear(); throw e; } |