Skip to content

Commit

Permalink
PatternMatchedCollection: implement equals/hashCode
Browse files Browse the repository at this point in the history
Test Plan: CI

Reviewed By: ttsugriy

fbshipit-source-id: dc422dc
  • Loading branch information
andrewjcg authored and facebook-github-bot committed Oct 3, 2017
1 parent d4de022 commit 18c9437
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/com/facebook/buck/rules/coercer/PatternMatchedCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,25 @@ public <V> PatternMatchedCollection<V> map(Function<T, V> func) {
.toImmutableList());
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof PatternMatchedCollection)) {
return false;
}

PatternMatchedCollection<?> that = (PatternMatchedCollection<?>) o;

return values.equals(that.values);
}

@Override
public int hashCode() {
return values.hashCode();
}

public static <T> Builder<T> builder() {
return new Builder<>();
}
Expand Down

0 comments on commit 18c9437

Please sign in to comment.