summaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
authorSmokowski, Steve (ss835w) <ss835w@us.att.com>2018-08-02 08:55:18 -0400
committerMarcus Williams <marcus.williams@intel.com>2018-08-02 17:22:53 +0000
commitaa3fac0c2021c54b626bbc6a13848e2af5e04c3c (patch)
treebf6c0df9a5e03e86279c6c806fe14d2c03d81bfa /adapters
parentd1930077521716bcea3f7a7bdd58dd820d7f68dd (diff)
Resolve Sonar Blocking issues
Issue-ID: SO-788 Change-Id: I4496ef16c56c980a81031ad01fcbb1524d135ea8 Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java31
1 files changed, 18 insertions, 13 deletions
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java
index a53cd0ce49..575853a21f 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java
@@ -22,6 +22,8 @@ package org.onap.so.adapters.vdu;
import java.util.Arrays;
import java.util.Objects;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
public class VduArtifact {
@@ -35,6 +37,21 @@ public class VduArtifact {
private byte[] content;
private ArtifactType type;
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof VduArtifact)) {
+ return false;
+ }
+ VduArtifact castOther = (VduArtifact) other;
+ return new EqualsBuilder().append(name, castOther.name).append(content, castOther.content)
+ .append(type, castOther.type).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(name).append(content).append(type).toHashCode();
+ }
+
// Default constructor
public VduArtifact() {}
@@ -64,17 +81,5 @@ public class VduArtifact {
this.type = type;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- VduArtifact that = (VduArtifact) o;
- return Objects.equals(name, that.name) &&
- Arrays.equals(content, that.content) &&
- type == that.type;
- }
+
}