{@inheritDoc} Two instances of Uri are equal if and only if they have the same string representation, which RFC 3986 calls "Simple String Comparison" (6.2.1). Callers with a higher layer expectation of equality (e.g. http://some%2Dhost:80/foo/./bar.txt ~= http://some-
(Object otherObj)
| 649 | * http://some-host/foo/bar.txt</code>) will experience false negatives. |
| 650 | */ |
| 651 | @Override |
| 652 | public boolean equals(Object otherObj) { |
| 653 | if (!(otherObj instanceof Uri)) { |
| 654 | return false; |
| 655 | } |
| 656 | Uri other = (Uri) otherObj; |
| 657 | return Objects.equals(scheme, other.scheme) |
| 658 | && Objects.equals(userInfo, other.userInfo) |
| 659 | && Objects.equals(host, other.host) |
| 660 | && Objects.equals(port, other.port) |
| 661 | && Objects.equals(path, other.path) |
| 662 | && Objects.equals(query, other.query) |
| 663 | && Objects.equals(fragment, other.fragment); |
| 664 | } |
| 665 | |
| 666 | @Override |
| 667 | public int hashCode() { |
no outgoing calls