This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 64498c93 authored by Daniel Rainer's avatar Daniel Rainer
Browse files

Refactor Person.equals

parent 08bc43da
2 merge requests!17Initial Merge to Prepare Release 1.0.0,!2Add gitlab metadata
......@@ -2,6 +2,7 @@ package at.ac.uibk.gitsearch.service.dto;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
......@@ -17,7 +18,7 @@ public class SearchResultsDTO {
this.externalName = externalName;
}
private String externalName;
private final String externalName;
@JsonValue
public String getExternalName() {
......@@ -74,27 +75,13 @@ public class SearchResultsDTO {
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
if (!(obj instanceof Person)) {
return false;
}
Person other = (Person) obj;
if (affiliation == null) {
if (other.affiliation != null)
return false;
} else if (!affiliation.equals(other.affiliation))
return false;
if (email == null) {
if (other.email != null)
return false;
} else if (!email.equals(other.email))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
return Objects.equals(this.affiliation, other.affiliation)
&& Objects.equals(this.email, other.email)
&& Objects.equals(this.name, other.name);
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment