Use lombok 50/69750/3
authorshrikantawachar <shrikant.awachar@amdocs.com>
Wed, 3 Oct 2018 14:11:52 +0000 (19:41 +0530)
committerAvi Gaffa <avi.gaffa@amdocs.com>
Tue, 9 Oct 2018 06:17:59 +0000 (06:17 +0000)
Use lombok to remove getters, equals , hashcode

Change-Id: If8edfc6cb59db2219ba323ecfe22c5102dee170e
Issue-ID: SDC-1816
Signed-off-by: shrikantawachar <shrikant.awachar@amdocs.com>
openecomp-be/lib/openecomp-sdc-datatypes-lib/pom.xml
openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/configuration/ImplementationConfiguration.java
openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java

index 5d7251e..fa71265 100644 (file)
             <artifactId>onap-configuration-management-api</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
     </dependencies>
 </project>
index a9a01fe..64ff886 100644 (file)
@@ -23,12 +23,16 @@ package org.openecomp.sdc.datatypes.configuration;
 import org.onap.config.api.Config;
 
 import java.util.Map;
+import lombok.Getter;
+import lombok.Setter;
 
 /**
  * @author shiria
  * @since November 30, 2016.
  */
 @Config(key = "")
+@Getter
+@Setter
 public class ImplementationConfiguration {
   @Config(key = "enable")
   Boolean enable = true;
@@ -40,24 +44,4 @@ public class ImplementationConfiguration {
   public Boolean isEnable() {
     return enable;
   }
-
-  public void setEnable(Boolean enable) {
-    this.enable = enable;
-  }
-
-  public String getImplementationClass() {
-    return implementationClass;
-  }
-
-  public void setImplementationClass(String implementationClass) {
-    this.implementationClass = implementationClass;
-  }
-
-  public Map<String, Object> getProperties() {
-    return properties;
-  }
-
-  public void setProperties(Map<String, Object> properties) {
-    this.properties = properties;
-  }
 }
index 3ec5f84..2c88e9d 100644 (file)
@@ -25,8 +25,11 @@ import org.apache.commons.collections4.CollectionUtils;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import lombok.Getter;
+import lombok.EqualsAndHashCode;
 
-
+@Getter
+@EqualsAndHashCode
 public class ErrorMessage {
   private final ErrorLevel level;
   private final String message;
@@ -36,36 +39,6 @@ public class ErrorMessage {
     this.message = message;
   }
 
-  public ErrorLevel getLevel() {
-    return level;
-  }
-
-  public String getMessage() {
-    return message;
-  }
-
-  @Override
-  public int hashCode() {
-    int result = level.hashCode();
-    result = 31 * result + message.hashCode();
-    return result;
-  }
-
-  @Override
-  public boolean equals(Object object) {
-    if (this == object) {
-      return true;
-    }
-    if (object == null || getClass() != object.getClass()) {
-      return false;
-    }
-
-    ErrorMessage that = (ErrorMessage) object;
-
-    return level == that.level && message.equals(that.message);
-
-  }
-
   public static class ErrorMessageUtil {
 
     /**