Skip to content

Commit

Permalink
Added proper equals/hash methods
Browse files Browse the repository at this point in the history
  • Loading branch information
depryf committed Aug 23, 2024
1 parent e1c1c80 commit 77d4061
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
*/
package com.imsweb.datagenerator.utils.dto;

import java.util.Objects;

@SuppressWarnings("unused")
public class FacilityFrequencyDto {

private String _npi;
Expand Down Expand Up @@ -103,4 +106,38 @@ public void setSpecialty03(String specialty) {
_specialty03 = specialty;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof FacilityFrequencyDto))
return false;
FacilityFrequencyDto that = (FacilityFrequencyDto)o;
return Objects.equals(_npi, that._npi)
&& Objects.equals(_name, that._name)
&& Objects.equals(_addressFirstLine, that._addressFirstLine)
&& Objects.equals(_addressSecondLine, that._addressSecondLine)
&& Objects.equals(_addressCity, that._addressCity)
&& Objects.equals(_addressState, that._addressState)
&& Objects.equals(_addressPostalCode, that._addressPostalCode)
&& Objects.equals(_addressTelephone, that._addressTelephone)
&& Objects.equals(_specialty01, that._specialty01)
&& Objects.equals(_specialty02, that._specialty02)
&& Objects.equals(_specialty03, that._specialty03);
}

@Override
public int hashCode() {
return Objects.hash(_npi,
_name,
_addressFirstLine,
_addressSecondLine,
_addressCity,
_addressState,
_addressPostalCode,
_addressTelephone,
_specialty01,
_specialty02,
_specialty03);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
*/
package com.imsweb.datagenerator.utils.dto;

import java.util.Objects;

@SuppressWarnings("unused")
public class PhysicianFrequencyDto {

private String _npi;
Expand Down Expand Up @@ -148,5 +151,48 @@ public void setSpecialty03(String specialty) {
_specialty03 = specialty;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof PhysicianFrequencyDto))
return false;
PhysicianFrequencyDto that = (PhysicianFrequencyDto)o;
return Objects.equals(_npi, that._npi)
&& Objects.equals(_lastName, that._lastName)
&& Objects.equals(_firstName, that._firstName)
&& Objects.equals(_middleName, that._middleName)
&& Objects.equals(_namePrefix, that._namePrefix)
&& Objects.equals(_nameSuffix, that._nameSuffix)
&& Objects.equals(_credentials, that._credentials)
&& Objects.equals(_addressFirstLine, that._addressFirstLine)
&& Objects.equals(_addressSecondLine, that._addressSecondLine)
&& Objects.equals(_addressCity, that._addressCity)
&& Objects.equals(_addressState, that._addressState)
&& Objects.equals(_addressPostalCode, that._addressPostalCode)
&& Objects.equals(_addressTelephone, that._addressTelephone)
&& Objects.equals(_specialty01, that._specialty01) && Objects.equals(_specialty02, that._specialty02)
&& Objects.equals(_specialty03, that._specialty03);
}

@Override
public int hashCode() {
return Objects.hash(_npi,
_lastName,
_firstName,
_middleName,
_namePrefix,
_nameSuffix,
_credentials,
_addressFirstLine,
_addressSecondLine,
_addressCity,
_addressState,
_addressPostalCode,
_addressTelephone,
_specialty01,
_specialty02,
_specialty03);
}
}

0 comments on commit 77d4061

Please sign in to comment.