toString() methods
with pluggable styling conventions. By default, ToStringCreator adheres
to Spring's toString() styling conventions.
| Modifier and Type | Field and Description |
|---|---|
| private final StringBuilder | |
| private static final ToStringStyler | DEFAULT_TO_STRING_STYLER
Default ToStringStyler instance used by this ToStringCreator. |
| private final Object | |
| private boolean | |
| private final ToStringStyler |
| Access | Constructor and Description |
|---|---|
| public | ToStringCreator(Object
the object to be stringified obj)Create a ToStringCreator for the given object. |
| public | ToStringCreator(Object
the object to be stringified obj, ValueStyler the ValueStyler encapsulating pretty-print instructions styler)Create a ToStringCreator for the given object, using the provided style. |
| public | ToStringCreator(Object
the object to be stringified obj, ToStringStyler the ToStringStyler encapsulating pretty-print instructions styler)Create a ToStringCreator for the given object, using the provided style. |
| Modifier and Type | Method and Description |
|---|---|
| public ToStringCreator | |
| public ToStringCreator | |
| public ToStringCreator | |
| public ToStringCreator | |
| public ToStringCreator | |
| public ToStringCreator | |
| public ToStringCreator | |
| public ToStringCreator | |
| public ToStringCreator | |
| private void | |
| public String | toString()
Overrides java. |
| buffer | back to summary |
|---|---|
| private final StringBuilder buffer | |
| DEFAULT_TO_STRING_STYLER | back to summary |
|---|---|
| private static final ToStringStyler DEFAULT_TO_STRING_STYLER Default ToStringStyler instance used by this ToStringCreator. | |
| object | back to summary |
|---|---|
| private final Object object | |
| styledFirstField | back to summary |
|---|---|
| private boolean styledFirstField | |
| styler | back to summary |
|---|---|
| private final ToStringStyler styler | |
| ToStringCreator | back to summary |
|---|---|
| public ToStringCreator(Object obj) Create a ToStringCreator for the given object.
| |
| ToStringCreator | back to summary |
|---|---|
| public ToStringCreator(Object obj, ValueStyler styler) Create a ToStringCreator for the given object, using the provided style.
| |
| ToStringCreator | back to summary |
|---|---|
| public ToStringCreator(Object obj, ToStringStyler styler) Create a ToStringCreator for the given object, using the provided style.
| |
| append | back to summary |
|---|---|
| public ToStringCreator append(String fieldName, byte value) Append a byte field value.
| |
| append | back to summary |
|---|---|
| public ToStringCreator append(String fieldName, short value) Append a short field value.
| |
| append | back to summary |
|---|---|
| public ToStringCreator append(String fieldName, int value) Append a integer field value.
| |
| append | back to summary |
|---|---|
| public ToStringCreator append(String fieldName, long value) Append a long field value.
| |
| append | back to summary |
|---|---|
| public ToStringCreator append(String fieldName, float value) Append a float field value.
| |
| append | back to summary |
|---|---|
| public ToStringCreator append(String fieldName, double value) Append a double field value.
| |
| append | back to summary |
|---|---|
| public ToStringCreator append(String fieldName, boolean value) Append a boolean field value.
| |
| append | back to summary |
|---|---|
| public ToStringCreator append(String fieldName, Object value) Append a field value.
| |
| append | back to summary |
|---|---|
| public ToStringCreator append(Object value) Append the provided value.
| |
| printFieldSeparatorIfNecessary | back to summary |
|---|---|
| private void printFieldSeparatorIfNecessary() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Return the String representation that this ToStringCreator built.
| |