Skip to content

Commit

Permalink
Add equals/hashcode to DefaultAggregatedHttpMessage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuraag Agrawal committed Aug 9, 2016
1 parent 21688e0 commit 544b8a0
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,32 @@ public String toString() {

return helper.toString();
}

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

if (!(obj instanceof AggregatedHttpMessage)) {
return false;
}

final DefaultAggregatedHttpMessage that = (DefaultAggregatedHttpMessage) obj;

return informationals.equals(that.informationals)
&& headers.equals(that.headers)
&& content.equals(that.content)
&& trailingHeaders.equals(that.trailingHeaders);

}

@Override
public int hashCode() {
int result = informationals.hashCode();
result = 31 * result + headers.hashCode();
result = 31 * result + content.hashCode();
result = 31 * result + trailingHeaders.hashCode();
return result;
}
}

0 comments on commit 544b8a0

Please sign in to comment.