From 2e3f83457728d9f39dc06c728b488bd5e98f083d Mon Sep 17 00:00:00 2001 From: shrek2000 Date: Wed, 5 Jun 2019 14:02:47 +0300 Subject: Add lombok support to simple classes Change-Id: Id4db17168cce9a6a02138c2c6bd74971159994dc Issue-ID: SDC-2354 Signed-off-by: shrek2000 --- .../sdc/tosca/datatypes/model/NodeTemplate.java | 129 +-------------------- 1 file changed, 6 insertions(+), 123 deletions(-) (limited to 'common') 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 index 0f99841f9a..82f1581fa9 100644 --- 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 @@ -23,13 +23,18 @@ package org.onap.sdc.tosca.datatypes.model; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.collections4.MapUtils; import org.onap.sdc.tosca.error.ToscaRuntimeException; import org.onap.sdc.tosca.services.YamlUtil; +@Getter +@Setter +@EqualsAndHashCode public class NodeTemplate implements Template, Cloneable { private String type; @@ -45,77 +50,6 @@ public class NodeTemplate implements Template, Cloneable { 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 getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - public List getDirectives() { - return directives; - } - - public void setDirectives(List directives) { - this.directives = directives; - } - - public Map getProperties() { - return properties; - } - - public void setProperties(Map properties) { - this.properties = properties; - } - - public Map getAttributes() { - return attributes; - } - - public void setAttributes(Map attributes) { - this.attributes = attributes; - } - - public List> getRequirements() { - return requirements; - } - - public void setRequirements(List> requirements) { - this.requirements = requirements; - } - - public Map getCapabilities() { - return capabilities; - } - - public void setCapabilities(Map capabilities) { - this.capabilities = capabilities; - } - - public Map getInterfaces() { - return interfaces; - } - - public void setInterfaces(Map interfaces) { - this.interfaces = interfaces; - } public Map getNormalizeInterfaces() { if (MapUtils.isEmpty(interfaces)) { @@ -146,29 +80,6 @@ public class NodeTemplate implements Template, Cloneable { } - public Map getArtifacts() { - return artifacts; - } - - public void setArtifacts(Map artifacts) { - this.artifacts = artifacts; - } - - public NodeFilter getNode_filter() { - return node_filter; - } - - public void setNode_filter(NodeFilter nodeFilter) { - this.node_filter = nodeFilter; - } - - public String getCopy() { - return copy; - } - - public void setCopy(String copy) { - this.copy = copy; - } @Override public NodeTemplate clone() { @@ -176,33 +87,5 @@ public class NodeTemplate implements Template, Cloneable { 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); - } } -- cgit 1.2.3-korg