diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java')
2 files changed, 8 insertions, 11 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java index b7d5568c8c..672a27ae34 100644 --- a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java @@ -14,7 +14,6 @@ * limitations under the License. */ - package org.openecomp.sdc.action.types; import java.util.Date; @@ -28,6 +27,7 @@ import org.openecomp.sdc.action.ActionConstants; import org.openecomp.sdc.action.dao.types.ActionEntity; import org.openecomp.sdc.versioning.dao.types.Version; + public class Action implements Comparable { private String actionUuId; private String actionInvariantUuId; @@ -249,6 +249,7 @@ public class Action implements Comparable { @Override public boolean equals(Object o) { + if (this == o) { return true; } @@ -258,17 +259,15 @@ public class Action implements Comparable { Action action = (Action) o; - if (!version.equals(action.version)) { + if (!Objects.equals(version, action.version)) { return false; } - return name.equals(action.name); + return Objects.equals(name, action.name); } @Override public int hashCode() { - int result = version.hashCode(); - result = 31 * result + name.hashCode(); - return result; + return com.google.common.base.Objects.hashCode(version, name); } } diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifact.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifact.java index dd30b681e9..ff4d908ed2 100644 --- a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifact.java +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifact.java @@ -21,12 +21,12 @@ package org.openecomp.sdc.action.types; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.google.common.base.Objects; import org.openecomp.sdc.action.dao.types.ActionArtifactEntity; import java.nio.ByteBuffer; import java.util.Date; - public class ActionArtifact { private String artifactUuId; @@ -131,15 +131,13 @@ public class ActionArtifact { public boolean equals(Object obj) { if (obj instanceof ActionArtifact) { ActionArtifact temp = (ActionArtifact) obj; - if (artifactUuId.equals(temp.getArtifactUuId())) { - return true; - } + return Objects.equal(artifactUuId, temp.getArtifactUuId()); } return false; } @Override public int hashCode() { - return artifactUuId.hashCode(); + return Objects.hashCode(artifactUuId); } } |