Fix toString(format)
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1127554 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7e6b6fce8d
commit
3513ecb0b7
|
@ -162,7 +162,7 @@ public abstract class Pair<L, R> implements Map.Entry<L, R>, Comparable<Pair<L,
|
||||||
/**
|
/**
|
||||||
* <p>Formats the receiver using the given format.</p>
|
* <p>Formats the receiver using the given format.</p>
|
||||||
*
|
*
|
||||||
* <p>This uses {@link Formattable} to perform the formatting. Two variable may
|
* <p>This uses {@link Formattable} to perform the formatting. Two variables may
|
||||||
* be used to embed the left and right elements. Use {@code %1$} for the left
|
* be used to embed the left and right elements. Use {@code %1$} for the left
|
||||||
* element (key) and {@code %2$} for the right element (value).
|
* element (key) and {@code %2$} for the right element (value).
|
||||||
* The default format used by {@code toString()} is {@code (%1$s,%2$s)}.</p>
|
* The default format used by {@code toString()} is {@code (%1$s,%2$s)}.</p>
|
||||||
|
@ -170,7 +170,7 @@ public abstract class Pair<L, R> implements Map.Entry<L, R>, Comparable<Pair<L,
|
||||||
* @param format the format string, optionally containing {@code %1$} and {@code %2$}, not null
|
* @param format the format string, optionally containing {@code %1$} and {@code %2$}, not null
|
||||||
* @return the formatted string, not null
|
* @return the formatted string, not null
|
||||||
*/
|
*/
|
||||||
public Object toString(String format) {
|
public String toString(String format) {
|
||||||
return String.format(format, getLeft(), getRight());
|
return String.format(format, getLeft(), getRight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue