public final class PrettyPrinter
extends java.lang.Object
toString(Object)| Modifier and Type | Field and Description |
|---|---|
static int |
ARRAY_ELLIPSIS
If an array is larger than this threshold (10), then it is printed as
{ elem-0, elem-1, elem-2, ... }
|
static int |
CHAR_ARRAY_ELLIPSIS
If a char array is larger than this threshold (20), then it is printed as
'abc'...
|
static int |
CHAR_SEQUENCE_ELLIPSIS
If a char sequence is longer than this threshold (100), then it is printed as
"abc"...
|
static int |
TOTAL_LENGTH_ELLIPSIS
If the length of the output exceeds this threshold (1024), then all remaining array
elements are printed as
"abc"...
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
toString(java.lang.Object o)
An improved version of
String.valueOf(Object). |
public static final int ARRAY_ELLIPSIS
{ elem-0, elem-1, elem-2, ... }public static final int CHAR_ARRAY_ELLIPSIS
'abc'...
public static final int CHAR_SEQUENCE_ELLIPSIS
"abc"...
public static final int TOTAL_LENGTH_ELLIPSIS
"abc"...
@Nullable public static java.lang.String toString(@Nullable java.lang.Object o)
String.valueOf(Object).
Objects are converted to strings in a Java-like format:
'\n'3B 3S 3L 3F 3D"abc\n""abcdef"... (123 chars)CharSequence:StringBuilder "abc\n"char[4] 'abc\n'char[99] 'abcdef'...int[3] { 1, 2, 3 }short[199] { 1, 2, 3, 4, 5, 6, ... }Object[3][] { [self], null, Object[2] { "abc", [parent] } }Object.toString()CharSequences are abbreviated, so the result string will effectively not be much longer than 1024 characters.