Merge pull request #12197 from eugenp/BAEL-5420-v2

BAEL-5420 fix equals method
This commit is contained in:
Loredana Crusoveanu 2022-05-11 12:57:56 +03:00 committed by GitHub
commit 4f2a448c2e
1 changed files with 9 additions and 3 deletions

View File

@ -28,9 +28,15 @@ public class EmployeeVO {
@Override
public boolean equals(Object obj) {
return Objects.equals(firstName, this.firstName)
&& Objects.equals(lastName, this.lastName)
&& Objects.equals(startDate, this.startDate);
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
EmployeeVO emp = (EmployeeVO) obj;
return Objects.equals(firstName, emp.firstName)
&& Objects.equals(lastName, emp.lastName)
&& Objects.equals(startDate, emp.startDate);
}
@Override