BAEL-5420 fix equals method

This commit is contained in:
Loredana Crusoveanu 2022-05-11 12:52:41 +03:00
parent f24b9af096
commit f5380f98f6
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