aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes')
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java4
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java20
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java16
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ContrailResourceTypes.java69
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ContrailV2ResourceTypes.java60
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/GroupTypeValues.java49
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java8
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java89
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java4
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java12
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java11
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java173
12 files changed, 203 insertions, 312 deletions
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java
index 62364e7a11..d4b6a88ba9 100644
--- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java
@@ -33,7 +33,6 @@ public enum DefinedHeatParameterTypes {
COMMA_DELIMITED_LIST("comma_delimited_list"),
JSON("json"),
BOOLEAN("boolean");
- // TODO : ASK SEGEV ABOUT STRING
private static Map<String, DefinedHeatParameterTypes> stringToDefinedType = new HashMap<>();
@@ -80,11 +79,8 @@ public enum DefinedHeatParameterTypes {
return (value instanceof Map) || (value instanceof List);
case STRING:
- //return value instanceof String;
return true;
-
default:
- // return false;
}
}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java
index 728b714868..dd487603e1 100644
--- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java
@@ -20,6 +20,9 @@
package org.openecomp.sdc.heat.datatypes.manifest;
+import org.apache.commons.collections4.CollectionUtils;
+
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
@@ -75,6 +78,18 @@ public class FileData {
this.data = data;
}
+ /**
+ * Add file data.
+ *
+ * @param data the data
+ */
+ public void addFileData(FileData data) {
+ if (CollectionUtils.isEmpty(this.data)) {
+ this.data = new ArrayList<>();
+ }
+ this.data.add(data);
+ }
+
public enum Type {
HEAT("HEAT"),
@@ -103,5 +118,10 @@ public class FileData {
return displayName;
}
+ public static boolean isArtifact(Type fileType)
+ {
+ return !Arrays.asList(HEAT,HEAT_ENV, HEAT_VOL).contains(fileType);
+ }
+
}
}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java
index 8aad825055..ebbb064ce9 100644
--- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java
@@ -26,7 +26,7 @@ import java.util.List;
public class Constraint {
private Object[] length;
private Integer[] range;
- private List<Object> valid_values;
+ private List<Object> validValues;
private String pattern;
public Constraint() {
@@ -40,12 +40,12 @@ public class Constraint {
this.range = new Integer[]{inRange[0], inRange[1]};
}
- public List<Object> getValid_values() {
- return valid_values;
+ public List<Object> getValidValues() {
+ return validValues;
}
- public void setValid_values(List<Object> validValues) {
- this.valid_values = validValues;
+ public void setValidValues(List<Object> validValues) {
+ this.validValues = validValues;
}
/**
@@ -54,10 +54,10 @@ public class Constraint {
* @param validValue the valid value
*/
public void addValidValue(Object validValue) {
- if (this.valid_values == null) {
- this.valid_values = new ArrayList<>();
+ if (this.validValues == null) {
+ this.validValues = new ArrayList<>();
}
- valid_values.add(validValue);
+ validValues.add(validValue);
}
public Object[] getLength() {
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ContrailResourceTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ContrailResourceTypes.java
new file mode 100644
index 0000000000..47eaefafec
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ContrailResourceTypes.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+public enum ContrailResourceTypes {
+ ATTACH_POLICY("OS::Contrail::AttachPolicy"),
+ SERVICE_INSTANCE("OS::Contrail::ServiceInstance"),
+ SERVICE_TEMPLATE("OS::Contrail::ServiceTemplate"),
+ NETWORK_POLICY("OS::Contrail::NetworkPolicy"),
+ VIRTUAL_NETWORK("OS::Contrail::VirtualNetwork");
+
+ private static Map<String, ContrailResourceTypes> stringToContrailResourceTypeMap;
+
+ static {
+ stringToContrailResourceTypeMap = new HashMap<>();
+
+ for (ContrailResourceTypes type : ContrailResourceTypes.values()) {
+ stringToContrailResourceTypeMap.put(type.contrailResourceType, type);
+ }
+ }
+
+ private String contrailResourceType;
+
+ ContrailResourceTypes(String contrailResourceType) {
+ this.contrailResourceType = contrailResourceType;
+ }
+
+ /**
+ * Find by contrail v 2 resource contrail resource types.
+ *
+ * @param contrailV2Resource the contrail v 2 resource
+ * @return the contrail resource types
+ */
+ public static ContrailResourceTypes findByContrailV2Resource(String contrailV2Resource) {
+ return contrailV2Resource == null ? null
+ : stringToContrailResourceTypeMap.get(contrailV2Resource);
+
+ }
+
+ public static boolean isResourceTypeContrail(String resourceType) {
+ return Objects.nonNull(findByContrailV2Resource(resourceType));
+ }
+
+ public String getContrailResourceType() {
+ return contrailResourceType;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ContrailV2ResourceTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ContrailV2ResourceTypes.java
new file mode 100644
index 0000000000..ff706093f8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ContrailV2ResourceTypes.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+public enum ContrailV2ResourceTypes {
+ NETWROK_IPAM("OS::ContrailV2::NetworkIpam"),
+ VIRTUAL_NETWORK("OS::ContrailV2::VirtualNetwork"),
+ NETWORK_POLICY("OS::ContrailV2::NetworkPolicy"),
+ VIRTUAL_MACHINE_INTERFACE("OS::ContrailV2::VirtualMachineInterface");
+
+ private static Map<String, ContrailV2ResourceTypes> stringToContrailV2ResourceTypeMap;
+
+ static {
+ stringToContrailV2ResourceTypeMap = new HashMap<>();
+
+ for (ContrailV2ResourceTypes type : ContrailV2ResourceTypes.values()) {
+ stringToContrailV2ResourceTypeMap.put(type.contrailV2ResourceType, type);
+ }
+ }
+
+ private String contrailV2ResourceType;
+
+ ContrailV2ResourceTypes(String contrailV2ResourceType) {
+ this.contrailV2ResourceType = contrailV2ResourceType;
+ }
+
+ public static ContrailV2ResourceTypes findByContrailV2Resource(String contrailV2Resource) {
+ return stringToContrailV2ResourceTypeMap.get(contrailV2Resource);
+ }
+
+ public static boolean isResourceTypeContrailV2(String resourceType) {
+ return Objects.nonNull(findByContrailV2Resource(resourceType));
+ }
+
+ public String getContrailV2ResourceType() {
+ return contrailV2ResourceType;
+ }
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/GroupTypeValues.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/GroupTypeValues.java
deleted file mode 100644
index 84259b1807..0000000000
--- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/GroupTypeValues.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.heat.datatypes.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public enum GroupTypeValues {
- EXCLUSIVITY("exclusivity"),
- AFFINITY("affinity"),
- DIVERSITY("diversity");
-
- private static List<String> groupTypeAsStrings;
-
- static {
- groupTypeAsStrings = new ArrayList<>();
- for (GroupTypeValues attGroupTypeValue : GroupTypeValues.values()) {
- groupTypeAsStrings.add(attGroupTypeValue.groupTypeValue);
- }
- }
-
- private String groupTypeValue;
-
- GroupTypeValues(String groupTypeValue) {
- this.groupTypeValue = groupTypeValue;
- }
-
- public static boolean isGroupTypeValid(String groupType) {
- return groupTypeAsStrings.contains(groupType);
- }
-}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java
index 4170d35d7a..294bb9e47e 100644
--- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java
@@ -36,8 +36,8 @@ public class HeatOrchestrationTemplate {
return heat_template_version;
}
- public void setHeat_template_version(String heatTemplateVersion) {
- this.heat_template_version = heatTemplateVersion;
+ public void setHeat_template_version(String heat_template_version) {
+ this.heat_template_version = heat_template_version;
}
public String getDescription() {
@@ -52,8 +52,8 @@ public class HeatOrchestrationTemplate {
return parameter_groups;
}
- public void setParameter_groups(List<ParameterGroup> parameterGroups) {
- this.parameter_groups = parameterGroups;
+ public void setParameter_groups(List<ParameterGroup> parameter_groups) {
+ this.parameter_groups = parameter_groups;
}
public Map<String, Parameter> getParameters() {
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java
index d4adfe7d32..b73fe385a6 100644
--- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java
@@ -26,93 +26,27 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
-/**
- * The enum Heat resources types.
- */
public enum HeatResourcesTypes {
- /**
- * Nova server resource type heat resources types.
- */
NOVA_SERVER_RESOURCE_TYPE("OS::Nova::Server"),
- /**
- * Nova server group resource type heat resources types.
- */
NOVA_SERVER_GROUP_RESOURCE_TYPE("OS::Nova::ServerGroup"),
- /**
- * Neutron port resource type heat resources types.
- */
NEUTRON_PORT_RESOURCE_TYPE("OS::Neutron::Port"),
- /**
- * Contrail network rule resource type heat resources types.
- */
CONTRAIL_NETWORK_RULE_RESOURCE_TYPE("OS::Contrail::NetworkPolicy"),
- /**
- * Contrail network attach rule resource type heat resources types.
- */
CONTRAIL_NETWORK_ATTACH_RULE_RESOURCE_TYPE("OS::Contrail::AttachPolicy"),
- /**
- * Contrail virtual network resource type heat resources types.
- */
CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE("OS::Contrail::VirtualNetwork"),
- /**
- * Cinder volume resource type heat resources types.
- */
CINDER_VOLUME_RESOURCE_TYPE("OS::Cinder::Volume"),
- /**
- * Cinder volume attachment resource type heat resources types.
- */
CINDER_VOLUME_ATTACHMENT_RESOURCE_TYPE("OS::Cinder::VolumeAttachment"),
- /**
- * Neutron net resource type heat resources types.
- */
NEUTRON_NET_RESOURCE_TYPE("OS::Neutron::Net"),
- /**
- * Neutron subnet resource type heat resources types.
- */
NEUTRON_SUBNET_RESOURCE_TYPE("OS::Neutron::Subnet"),
- /**
- * Neutron security group resource type heat resources types.
- */
NEUTRON_SECURITY_GROUP_RESOURCE_TYPE("OS::Neutron::SecurityGroup"),
- /**
- * Heat software config type heat resources types.
- */
HEAT_SOFTWARE_CONFIG_TYPE("OS::Heat::SoftwareConfig"),
- /**
- * Heat cloud config type heat resources types.
- */
HEAT_CLOUD_CONFIG_TYPE("OS::Heat::CloudConfig"),
- /**
- * Heat multipart mime type heat resources types.
- */
HEAT_MULTIPART_MIME_TYPE("OS::Heat::MultipartMime"),
- /**
- * Heat contrail network ipam type heat resources types.
- */
HEAT_CONTRAIL_NETWORK_IPAM_TYPE("OS::Contrail::NetworkIpam"),
- /**
- * Contrail v 2 virtual network resource type heat resources types.
- */
CONTRAIL_V2_VIRTUAL_NETWORK_RESOURCE_TYPE("OS::ContrailV2::VirtualNetwork"),
- /**
- * Contrail v 2 virtual machine interface resource type heat resources types.
- */
CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE("OS::ContrailV2::VirtualMachineInterface"),
- /**
- * Contrail service template heat resources types.
- */
CONTRAIL_SERVICE_TEMPLATE("OS::Contrail::ServiceTemplate"),
- /**
- * Contrail service instance heat resources types.
- */
CONTRAIL_SERVICE_INSTANCE("OS::Contrail::ServiceInstance"),
- /**
- * Contrail v 2 network rule resource type heat resources types.
- */
CONTRAIL_V2_NETWORK_RULE_RESOURCE_TYPE("OS::ContrailV2::NetworkPolicy"),
- /**
- * Resource group resource type heat resources types.
- */
RESOURCE_GROUP_RESOURCE_TYPE("OS::Heat::ResourceGroup");
private static Map<String, HeatResourcesTypes> stringToHeatResourceTypeMap;
@@ -132,22 +66,10 @@ public enum HeatResourcesTypes {
this.heatResource = heatResource;
}
- /**
- * Find by heat resource heat resources types.
- *
- * @param heatResource the heat resource
- * @return the heat resources types
- */
public static HeatResourcesTypes findByHeatResource(String heatResource) {
return stringToHeatResourceTypeMap.get(heatResource);
}
- /**
- * Is resource type valid boolean.
- *
- * @param resourceType the resource type
- * @return the boolean
- */
public static boolean isResourceTypeValid(String resourceType) {
return Objects.nonNull(findByHeatResource(resourceType));
}
@@ -159,6 +81,7 @@ public enum HeatResourcesTypes {
* @return the boolean
*/
public static boolean isResourceExpectedToBeExposed(String resourceType) {
+ //todo - check
return (resourceType.equals(NOVA_SERVER_GROUP_RESOURCE_TYPE.getHeatResource())
|| resourceType.equals(CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource())
|| resourceType.equals(NEUTRON_NET_RESOURCE_TYPE.getHeatResource())
@@ -184,21 +107,11 @@ public enum HeatResourcesTypes {
return result;
}
- /**
- * Gets heat resource.
- *
- * @return the heat resource
- */
public String getHeatResource() {
return heatResource;
}
- /**
- * Sets heat resource.
- *
- * @param heatResource the heat resource
- */
public void setHeatResource(String heatResource) {
this.heatResource = heatResource;
}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java
index 63681cc80c..d419738942 100644
--- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java
@@ -60,8 +60,8 @@ public class Parameter {
return _default;
}
- public void set_default(Object defaultValue) {
- this._default = defaultValue;
+ public void set_default(Object _default) {
+ this._default = _default;
}
public boolean isHidden() {
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java
index f4c3cd91cb..2c70105da9 100644
--- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java
@@ -58,24 +58,24 @@ public class Resource {
return depends_on;
}
- public void setDepends_on(Object dependsOn) {
- this.depends_on = dependsOn;
+ public void setDepends_on(Object depends_on) {
+ this.depends_on = depends_on;
}
public Object getUpdate_policy() {
return update_policy;
}
- public void setUpdate_policy(Object updatePolicy) {
- this.update_policy = updatePolicy;
+ public void setUpdate_policy(Object update_policy) {
+ this.update_policy = update_policy;
}
public Object getDeletion_policy() {
return deletion_policy;
}
- public void setDeletion_policy(Object deletionPolicy) {
- this.deletion_policy = deletionPolicy;
+ public void setDeletion_policy(Object deletion_policy) {
+ this.deletion_policy = deletion_policy;
}
@Override
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java
index b5c263f545..95ae4e59c7 100644
--- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java
@@ -73,6 +73,11 @@ public class Artifact implements Comparable<Artifact> {
this.errors.add(error);
}
+ @Override
+ public int hashCode() {
+ int result = fileName.hashCode();
+ return result;
+ }
@Override
public boolean equals(Object obj) {
@@ -93,12 +98,6 @@ public class Artifact implements Comparable<Artifact> {
}
@Override
- public int hashCode() {
- int result = fileName.hashCode();
- return result;
- }
-
- @Override
public int compareTo(Artifact artifact) {
return artifact.getFileName().compareTo(this.getFileName());
}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java
index c86425fd43..5313d4d370 100644
--- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java
@@ -30,9 +30,6 @@ import java.util.List;
import java.util.Set;
import java.util.TreeSet;
-/**
- * The type Heat structure tree.
- */
public class HeatStructureTree implements Comparable<HeatStructureTree> {
private String fileName;
@@ -40,27 +37,18 @@ public class HeatStructureTree implements Comparable<HeatStructureTree> {
private Boolean isBase;
private HeatStructureTree env;
private List<ErrorMessage> errors;
- private Set<HeatStructureTree> HEAT;
+ private Set<HeatStructureTree> heat;
private Set<HeatStructureTree> volume;
private Set<HeatStructureTree> network;
private Set<HeatStructureTree> nested;
private Set<HeatStructureTree> other;
private Set<Artifact> artifacts;
- /**
- * Instantiates a new Heat structure tree.
- */
public HeatStructureTree() {
}
;
- /**
- * Instantiates a new Heat structure tree.
- *
- * @param fileName the file name
- * @param isBase the is base
- */
public HeatStructureTree(String fileName, boolean isBase) {
setBase(isBase);
setFileName(fileName);
@@ -84,102 +72,47 @@ public class HeatStructureTree implements Comparable<HeatStructureTree> {
return null;
}
- /**
- * Sets type.
- *
- * @param type the type
- */
public void setType(FileData.Type type) {
this.type = type;
}
- /**
- * Gets base.
- *
- * @return the base
- */
public Boolean getBase() {
return isBase;
}
- /**
- * Sets base.
- *
- * @param base the base
- */
public void setBase(Boolean base) {
isBase = base;
}
- /**
- * Gets file name.
- *
- * @return the file name
- */
public String getFileName() {
return fileName;
}
- /**
- * Sets file name.
- *
- * @param file the file
- */
public void setFileName(String file) {
this.fileName = file;
}
- /**
- * Gets heat.
- *
- * @return the heat
- */
- @JsonProperty(value = "HEAT")
- public Set<HeatStructureTree> getHEAT() {
- return HEAT;
+ @JsonProperty(value = "heat")
+ public Set<HeatStructureTree> getHeat() {
+ return heat;
}
- /**
- * Sets heat.
- *
- * @param heat the heat
- */
- public void setHEAT(Set<HeatStructureTree> heat) {
- this.HEAT = heat;
+ public void setHeat(Set<HeatStructureTree> heat) {
+ this.heat = heat;
}
- /**
- * Gets nested.
- *
- * @return the nested
- */
public Set<HeatStructureTree> getNested() {
return nested;
}
- /**
- * Sets nested.
- *
- * @param nested the nested
- */
public void setNested(Set<HeatStructureTree> nested) {
this.nested = nested;
}
- /**
- * Gets artifacts.
- *
- * @return the artifacts
- */
public Set<Artifact> getArtifacts() {
return artifacts;
}
- /**
- * Sets artifacts.
- *
- * @param artifacts the artifacts
- */
public void setArtifacts(Set<Artifact> artifacts) {
this.artifacts = artifacts;
}
@@ -210,56 +143,26 @@ public class HeatStructureTree implements Comparable<HeatStructureTree> {
this.artifacts.add(artifact);
}
- /**
- * Gets env.
- *
- * @return the env
- */
public HeatStructureTree getEnv() {
return env;
}
- /**
- * Sets env.
- *
- * @param env the env
- */
public void setEnv(HeatStructureTree env) {
this.env = env;
}
- /**
- * Gets volume.
- *
- * @return the volume
- */
public Set<HeatStructureTree> getVolume() {
return volume;
}
- /**
- * Sets volume.
- *
- * @param volume the volume
- */
public void setVolume(Set<HeatStructureTree> volume) {
this.volume = volume;
}
- /**
- * Gets network.
- *
- * @return the network
- */
public Set<HeatStructureTree> getNetwork() {
return network;
}
- /**
- * Sets network.
- *
- * @param network the network
- */
public void setNetwork(Set<HeatStructureTree> network) {
this.network = network;
}
@@ -297,12 +200,12 @@ public class HeatStructureTree implements Comparable<HeatStructureTree> {
*
* @param heat the heat
*/
- public void addHeatToHEATList(HeatStructureTree heat) {
- if (this.HEAT == null) {
- this.HEAT = new TreeSet<>();
+ public void addHeatToHeatList(HeatStructureTree heat) {
+ if (this.heat == null) {
+ this.heat = new TreeSet<>();
}
- this.HEAT.add(heat);
+ this.heat.add(heat);
}
/**
@@ -351,6 +254,21 @@ public class HeatStructureTree implements Comparable<HeatStructureTree> {
}
@Override
+ public int hashCode() {
+ int result1 = fileName != null ? fileName.hashCode() : 0;
+ result1 = 31 * result1 + (env != null ? env.hashCode() : 0);
+ result1 = 31 * result1 + (heat != null ? heat.hashCode() : 0);
+ result1 = 31 * result1 + (volume != null ? volume.hashCode() : 0);
+ result1 = 31 * result1 + (network != null ? network.hashCode() : 0);
+ result1 = 31 * result1 + (artifacts != null ? artifacts.hashCode() : 0);
+ result1 = 31 * result1 + (nested != null ? nested.hashCode() : 0);
+ result1 = 31 * result1 + (errors != null ? errors.hashCode() : 0);
+
+
+ return result1;
+ }
+
+ @Override
public boolean equals(Object other) {
if (this == other) {
return true;
@@ -368,7 +286,7 @@ public class HeatStructureTree implements Comparable<HeatStructureTree> {
if (env != null ? !env.equals(heatStructureTree.env) : heatStructureTree.env != null) {
return false;
}
- if (HEAT != null ? !HEAT.equals(heatStructureTree.HEAT) : heatStructureTree.HEAT != null) {
+ if (heat != null ? !heat.equals(heatStructureTree.heat) : heatStructureTree.heat != null) {
return false;
}
if (volume != null ? !volume.equals(heatStructureTree.volume)
@@ -395,35 +313,10 @@ public class HeatStructureTree implements Comparable<HeatStructureTree> {
return true;
}
- @Override
- public int hashCode() {
- int result1 = fileName != null ? fileName.hashCode() : 0;
- result1 = 31 * result1 + (env != null ? env.hashCode() : 0);
- result1 = 31 * result1 + (HEAT != null ? HEAT.hashCode() : 0);
- result1 = 31 * result1 + (volume != null ? volume.hashCode() : 0);
- result1 = 31 * result1 + (network != null ? network.hashCode() : 0);
- result1 = 31 * result1 + (artifacts != null ? artifacts.hashCode() : 0);
- result1 = 31 * result1 + (nested != null ? nested.hashCode() : 0);
- result1 = 31 * result1 + (errors != null ? errors.hashCode() : 0);
-
-
- return result1;
- }
-
- /**
- * Gets errors.
- *
- * @return the errors
- */
public List<ErrorMessage> getErrors() {
return errors;
}
- /**
- * Sets errors.
- *
- * @param errors the errors
- */
public void setErrors(List<ErrorMessage> errors) {
this.errors = errors;
}
@@ -442,26 +335,16 @@ public class HeatStructureTree implements Comparable<HeatStructureTree> {
}
}
- /**
- * Gets other.
- *
- * @return the other
- */
public Set<HeatStructureTree> getOther() {
return other;
}
- /**
- * Sets other.
- *
- * @param other the other
- */
public void setOther(Set<HeatStructureTree> other) {
this.other = other;
}
@Override
- public int compareTo(HeatStructureTree heatStructureTree) {
- return heatStructureTree.getFileName().compareTo(this.getFileName());
+ public int compareTo(HeatStructureTree obj) {
+ return obj.getFileName().compareTo(this.getFileName());
}
}