Skip to content

Commit

Permalink
Added missing equals and hashcode
Browse files Browse the repository at this point in the history
  • Loading branch information
david-buderus committed May 30, 2024
1 parent fcefd32 commit 622e88e
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.NotNull;
import java.util.Objects;

/**
* An effect which directly changes the stats of the given equipment.
Expand Down Expand Up @@ -52,4 +53,25 @@ public float apply(EUpgradeEquipmentManipulator manipulator, float value) {
public EUpgradeEffectCalculation getCalculation() {
return calculation;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
EquipmentUpgradeEffect that = (EquipmentUpgradeEffect) o;
return Float.compare(that.value, value) == 0 && upgradeManipulator == that.upgradeManipulator
&& getCalculation() == that.getCalculation();
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), value, upgradeManipulator, getCalculation());
}
}

0 comments on commit 622e88e

Please sign in to comment.