From 18ae7612481c386db22fe983dedf331a29141444 Mon Sep 17 00:00:00 2001 From: Francis Toth Date: Sat, 2 May 2020 10:16:17 -0400 Subject: Refactor CsarUtils::WriteArtifactDefinition Signed-off-by: Francis Toth Change-Id: I167a05d8fbc2085a3e25eeb5bfd6b30f0e80462e Issue-ID: SDC-2812 --- .../sdc/be/datatypes/elements/ArtifactDataDefinition.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'common-be/src/main/java') diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java index 7360c03f44..3b52eb97df 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ArtifactDataDefinition.java @@ -27,8 +27,7 @@ import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; import java.util.ArrayList; import java.util.List; import java.util.Map; - -//import com.google.gson.reflect.TypeToken; +import org.openecomp.sdc.common.api.ArtifactTypeEnum; public class ArtifactDataDefinition extends ToscaDataDefinition { @@ -92,6 +91,10 @@ public class ArtifactDataDefinition extends ToscaDataDefinition { return (String) getToscaPresentationValue(JsonPresentationFields.ARTIFACT_TYPE); } + public boolean isHeatEnvType() { + return getArtifactType().equals(ArtifactTypeEnum.HEAT_ENV.getType()); + } + public void setArtifactType(String artifactType) { setToscaPresentationValue(JsonPresentationFields.ARTIFACT_TYPE, artifactType); @@ -205,6 +208,10 @@ public class ArtifactDataDefinition extends ToscaDataDefinition { return (String) getToscaPresentationValue(JsonPresentationFields.ES_ID); } + public boolean hasNoMandatoryEsId() { + return getEsId() == null && getMandatory(); + } + public void setEsId(String esId) { setToscaPresentationValue(JsonPresentationFields.ES_ID, esId); } -- cgit 1.2.3-korg