Skip to content

Commit bb19a7e

Browse files
chore: define equality of medical technology scenarios only based on medical technology type
1 parent a8b5ee1 commit bb19a7e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/env/application/presenter/configuration/model/scenario/MedicalTechnologyScenario.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
package application.presenter.configuration.model.scenario;
1010

11+
import java.util.Objects;
12+
1113
/**
1214
* Class that models a medical technology scenario config.
1315
*/
@@ -78,4 +80,21 @@ public Double getSurgicalIlluminance() {
7880
public void setSurgicalIlluminance(final Double surgicalIlluminance) {
7981
this.surgicalIlluminance = surgicalIlluminance;
8082
}
83+
84+
@Override
85+
public final boolean equals(final Object other) {
86+
if (this == other) {
87+
return true;
88+
}
89+
if (other == null || this.getClass() != other.getClass()) {
90+
return false;
91+
}
92+
final MedicalTechnologyScenario that = (MedicalTechnologyScenario) other;
93+
return this.getMedicalTechnologyType().equals(that.getMedicalTechnologyType());
94+
}
95+
96+
@Override
97+
public final int hashCode() {
98+
return Objects.hash(this.getMedicalTechnologyType());
99+
}
81100
}

0 commit comments

Comments
 (0)