Use lombok in apex-pdp #5
[policy/apex-pdp.git] / testsuites / integration / integration-context-test / src / test / java / org / onap / policy / apex / testsuites / integration / context / entities / ArtifactKeyTestEntity.java
index 19c3d33..3b8394d 100644 (file)
@@ -2,6 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2021 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.
@@ -27,6 +28,11 @@ import javax.persistence.EmbeddedId;
 import javax.persistence.Entity;
 import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlElement;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
@@ -37,6 +43,11 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
  */
 @Entity
 @Table(name = "ArtifactKeyTestEntity")
+@Getter
+@Setter
+@ToString
+@EqualsAndHashCode(callSuper = false)
+@AllArgsConstructor
 public class ArtifactKeyTestEntity extends AxConcept {
     private static final long serialVersionUID = -2962570563281067896L;
 
@@ -64,25 +75,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         this.doubleValue = doubleValue;
     }
 
-    /**
-     * Instantiates a new artifact key test entity.
-     *
-     * @param key the key
-     * @param doubleValue the double value
-     */
-    public ArtifactKeyTestEntity(final AxArtifactKey key, final Double doubleValue) {
-        this.key = key;
-        this.doubleValue = doubleValue;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public AxArtifactKey getKey() {
-        return key;
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -91,15 +83,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         return Arrays.asList((AxKey) getKey());
     }
 
-    /**
-     * Sets the key.
-     *
-     * @param key the new key
-     */
-    public void setKey(final AxArtifactKey key) {
-        this.key = key;
-    }
-
     /**
      * Check set key.
      *
@@ -109,24 +92,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         return (this.key != null);
     }
 
-    /**
-     * Gets the double value.
-     *
-     * @return the double value
-     */
-    public double getDoubleValue() {
-        return doubleValue;
-    }
-
-    /**
-     * Sets the double value.
-     *
-     * @param doubleValue the new double value
-     */
-    public void setDoubleValue(final double doubleValue) {
-        this.doubleValue = doubleValue;
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -143,14 +108,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         key.clean();
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public String toString() {
-        return "ArtifactKeyTestEntity [key=" + key + ", doubleValue=" + doubleValue + "]";
-    }
-
     /**
      * {@inheritDoc}.
      */
@@ -171,42 +128,6 @@ public class ArtifactKeyTestEntity extends AxConcept {
         }
     }
 
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((key == null) ? 0 : key.hashCode());
-        return result;
-    }
-
-    /**
-     * {@inheritDoc}.
-     */
-    @Override
-    public boolean equals(final Object obj) {
-        if (obj == null) {
-            return false;
-        }
-        if (this == obj) {
-            return true;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final ArtifactKeyTestEntity other = (ArtifactKeyTestEntity) obj;
-        if (key == null) {
-            if (other.key != null) {
-                return false;
-            }
-        } else if (!key.equals(other.key)) {
-            return false;
-        }
-        return (Double.compare(doubleValue, other.doubleValue) == 0);
-    }
-
     /**
      * {@inheritDoc}.
      */