Skip to content

Commit

Permalink
Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Sep 4, 2024
1 parent 6d29fd4 commit 586358f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/org/apache/commons/lang3/tuple/Pair.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,14 @@ public String toString() {
/**
* Formats the receiver using the given format.
*
* <p>This uses {@link java.util.Formattable} to perform the formatting. Two variables may
* be used to embed the left and right elements. Use {@code %1$s} for the left
* element (key) and {@code %2$s} for the right element (value).
* The default format used by {@code toString()} is {@code (%1$s,%2$s)}.</p>
* <p>
* This uses {@link String#format(String, Object...)} to the format. Two variables may be used to embed the left and right elements. Use {@code %1$s} for
* the left element (key) and {@code %2$s} for the right element (value).
* </p>
*
* @param format the format string, optionally containing {@code %1$s} and {@code %2$s}, not null
* @param format the format string, optionally containing {@code %1$s} and {@code %2$s}, not null.
* @return the formatted string, not null
* @see String#format(String, Object...)
*/
public String toString(final String format) {
return String.format(format, getLeft(), getRight());
Expand Down

0 comments on commit 586358f

Please sign in to comment.