Add lombok support to simple classes 47/89347/2
authorshrek2000 <orenkle@amdocs.com>
Wed, 5 Jun 2019 11:02:47 +0000 (14:02 +0300)
committerAvi Gaffa <avi.gaffa@amdocs.com>
Wed, 5 Jun 2019 13:16:18 +0000 (13:16 +0000)
Change-Id: Id4db17168cce9a6a02138c2c6bd74971159994dc
Issue-ID: SDC-2354
Signed-off-by: shrek2000 <orenkle@amdocs.com>
common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/NodeTemplate.java

index 0f99841..82f1581 100644 (file)
@@ -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<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, InterfaceDefinitionTemplate> getNormalizeInterfaces() {
         if (MapUtils.isEmpty(interfaces)) {
@@ -146,29 +80,6 @@ public class NodeTemplate implements Template, Cloneable {
 
     }
 
-    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 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);
-    }
 }