summaryrefslogtreecommitdiffstats
path: root/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/NodeTemplate.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/NodeTemplate.java')
-rw-r--r--common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/NodeTemplate.java177
1 files changed, 177 insertions, 0 deletions
diff --git a/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/NodeTemplate.java b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/NodeTemplate.java
new file mode 100644
index 0000000000..258a7ec2cd
--- /dev/null
+++ b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/NodeTemplate.java
@@ -0,0 +1,177 @@
+/*-
+ * ============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.onap.sdc.tosca.datatypes.model;
+
+import org.onap.sdc.tosca.services.YamlUtil;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+
+public class NodeTemplate implements Template {
+
+ private String type;
+ private String description;
+ private Map<String, String> metadata;
+ private List<String> directives;
+ private Map<String, Object> properties;
+ private Map<String, Object> attributes;
+ private List<Map<String, RequirementAssignment>> requirements;
+ private Map<String, CapabilityAssignment> capabilities;
+ private Map<String, Object> interfaces;
+ private Map<String, ArtifactDefinition> artifacts;
+ private NodeFilter node_filter;
+ private String copy;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Map<String, String> getMetadata() {
+ return metadata;
+ }
+
+ public void setMetadata(Map<String, String> metadata) {
+ this.metadata = metadata;
+ }
+
+ public List<String> getDirectives() {
+ return directives;
+ }
+
+ public void setDirectives(List<String> directives) {
+ this.directives = directives;
+ }
+
+ public Map<String, Object> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, Object> properties) {
+ this.properties = properties;
+ }
+
+ public Map<String, Object> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Map<String, Object> attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<Map<String, RequirementAssignment>> getRequirements() {
+ return requirements;
+ }
+
+ public void setRequirements(List<Map<String, RequirementAssignment>> requirements) {
+ this.requirements = requirements;
+ }
+
+ public Map<String, CapabilityAssignment> getCapabilities() {
+ return capabilities;
+ }
+
+ public void setCapabilities(Map<String, CapabilityAssignment> capabilities) {
+ this.capabilities = capabilities;
+ }
+
+ public Map<String, Object> getInterfaces() {
+ return interfaces;
+ }
+
+ public void setInterfaces(Map<String, Object> interfaces) {
+ this.interfaces = interfaces;
+ }
+
+ public Map<String, ArtifactDefinition> getArtifacts() {
+ return artifacts;
+ }
+
+ public void setArtifacts(Map<String, ArtifactDefinition> artifacts) {
+ this.artifacts = artifacts;
+ }
+
+ public NodeFilter getNode_filter() {
+ return node_filter;
+ }
+
+ public void setNode_filter(NodeFilter node_filter) {
+ this.node_filter = node_filter;
+ }
+
+ public String getCopy() {
+ return copy;
+ }
+
+ public void setCopy(String copy) {
+ this.copy = copy;
+ }
+
+ @Override
+ public NodeTemplate clone() {
+ YamlUtil yamlUtil = new YamlUtil();
+ return yamlUtil.yamlToObject(yamlUtil.objectToYaml(this), NodeTemplate.class);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof NodeTemplate)) {
+ return false;
+ }
+ NodeTemplate that = (NodeTemplate) o;
+ return Objects.equals(type, that.type) &&
+ Objects.equals(description, that.description) &&
+ Objects.equals(metadata, that.metadata) &&
+ Objects.equals(directives, that.directives) &&
+ Objects.equals(properties, that.properties) &&
+ Objects.equals(attributes, that.attributes) &&
+ Objects.equals(requirements, that.requirements) &&
+ Objects.equals(capabilities, that.capabilities) &&
+ Objects.equals(interfaces, that.interfaces) &&
+ Objects.equals(artifacts, that.artifacts) &&
+ Objects.equals(node_filter, that.node_filter) &&
+ Objects.equals(copy, that.copy);
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects
+ .hash(type, description, metadata, directives, properties, attributes, requirements,
+ capabilities, interfaces, artifacts, node_filter, copy);
+ }
+}