Skip to content

Commit

Permalink
Implement equals and hashCode at the FileSet level, following p…
Browse files Browse the repository at this point in the history
…roject conventions (for flapdoodle-oss#43)
  • Loading branch information
Michael Ahlers committed Aug 15, 2016
1 parent c7f4540 commit ef9a9dc
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,30 @@ public FileSet build() {
}
}

@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}

if (other == null) {
return false;
}

if (!(other instanceof FileSet)) {
return false;
}

FileSet files = (FileSet) other;

return !(_entries != null ? !_entries.equals(files._entries) : files._entries != null);
}

@Override
public int hashCode() {
int result = 0;
result = 31 * result + (_entries != null ? _entries.hashCode() : 0);
return result;
}

}

0 comments on commit ef9a9dc

Please sign in to comment.