Skip to content

Commit

Permalink
Use the Objects utilities for equals and hashCode
Browse files Browse the repository at this point in the history
  • Loading branch information
joegallo committed Dec 10, 2024
1 parent 6f2f1b4 commit 56cccf5
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

/**
* A {@link LifecycleAction} which sets the index's priority. The higher the priority, the faster the recovery.
Expand Down Expand Up @@ -107,15 +108,13 @@ public List<Step> toSteps(Client client, String phase, StepKey nextStepKey) {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

SetPriorityAction that = (SetPriorityAction) o;

return recoveryPriority != null ? recoveryPriority.equals(that.recoveryPriority) : that.recoveryPriority == null;
return Objects.equals(recoveryPriority, that.recoveryPriority);
}

@Override
public int hashCode() {
return recoveryPriority != null ? recoveryPriority.hashCode() : 0;
return Objects.hash(recoveryPriority);
}

@Override
Expand Down

0 comments on commit 56cccf5

Please sign in to comment.