Skip to content

Commit

Permalink
Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Dec 10, 2024
1 parent f480345 commit 23f0816
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/org/apache/commons/lang3/tuple/Pair.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,11 @@ public R getValue() {

/**
* Returns a suitable hash code.
* <p>
* The hash code follows the definition in {@code Map.Entry}.
* </p>
*
* @return the hash code
* @return the hash code.
*/
@Override
public int hashCode() {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/apache/commons/lang3/tuple/Triple.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,15 @@ public boolean equals(final Object obj) {

/**
* Returns a suitable hash code.
* <p>
* The hash code is adapted from the definition in {@code Map.Entry}.
* </p>
*
* @return the hash code
* @return the hash code.
*/
@Override
public int hashCode() {
// See Map.Entry API specification
return Objects.hashCode(getLeft()) ^ Objects.hashCode(getMiddle()) ^ Objects.hashCode(getRight());
}

Expand Down

0 comments on commit 23f0816

Please sign in to comment.