MultilineRecursiveToStringStyle
- public class org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle extends RecursiveToStringStyle[source]
Works with
ToStringBuilderto create a “deep”toString. But instead a single line like theRecursiveToStringStylethis creates a multiline String similar to theToStringStyle#MULTI_LINE_STYLE.To use this class write code as follows:
public class Job { String title; ... } public class Person { String name; int age; boolean smoker; Job job; ... public String toString() { return new ReflectionToStringBuilder(this, new MultilineRecursiveToStringStyle()).toString(); } }
This will produce a toString of the format:Person@7f54[ <br> name=Stephen, <br> age=29, <br> smokealse, <br> job=Job@43cd2[ <br> title=Manager <br> ] <br> ]- Since:
3.4
Constructors
Constructs a new instance. |
Methods
Appends to the |
|
Appends to the |
|
Appends to the |
|
Appends to the |
|
Appends to the |
|
Appends to the |
|
Appends to the |
|
Appends to the |
|
Appends to the |
|
Appends to the |
|
Appends to the |
- @Override protected void appendDetail(StringBuffer buffer, String fieldName, boolean[] array)[source]
Appends to the
toStringthe detail of abooleanarray.- Parameters:
buffer – The
StringBufferto populate.fieldName – The field name, typically not used as already appended.
array – The array to add to the
toString, notnull.
- @Override protected void appendDetail(StringBuffer buffer, String fieldName, byte[] array)[source]
Appends to the
toStringthe detail of abytearray.- Parameters:
buffer – The
StringBufferto populate.fieldName – The field name, typically not used as already appended.
array – The array to add to the
toString, notnull.
- @Override protected void appendDetail(StringBuffer buffer, String fieldName, char[] array)[source]
Appends to the
toStringthe detail of achararray.- Parameters:
buffer – The
StringBufferto populate.fieldName – The field name, typically not used as already appended.
array – The array to add to the
toString, notnull.
- @Override protected void appendDetail(StringBuffer buffer, String fieldName, double[] array)[source]
Appends to the
toStringthe detail of adoublearray.- Parameters:
buffer – The
StringBufferto populate.fieldName – The field name, typically not used as already appended
array – The array to add to the
toString, notnull.
- @Override protected void appendDetail(StringBuffer buffer, String fieldName, float[] array)[source]
Appends to the
toStringthe detail of afloatarray.- Parameters:
buffer – The
StringBufferto populate.fieldName – The field name, typically not used as already appended.
array – The array to add to the
toString, notnull.
- @Override protected void appendDetail(StringBuffer buffer, String fieldName, int[] array)[source]
Appends to the
toStringthe detail of anintarray.- Parameters:
buffer – The
StringBufferto populate.fieldName – The field name, typically not used as already appended.
array – The array to add to the
toString, notnull.
- @Override public void appendDetail(StringBuffer buffer, String fieldName, Object value)[source]
Appends to the
toStringanObjectvalue, printing the full detail of theObject.- Parameters:
buffer – The
StringBufferto populate.fieldName – The field name, typically not used as already appended.
value – The value to add to the
toString, notnull.
- @Override protected void appendDetail(StringBuffer buffer, String fieldName, Object[] array)[source]
Appends to the
toStringthe detail of anObjectarray.- Parameters:
buffer – The
StringBufferto populate.fieldName – The field name, typically not used as already appended.
array – The array to add to the
toString, notnull.
- @Override protected void appendDetail(StringBuffer buffer, String fieldName, long[] array)[source]
Appends to the
toStringthe detail of alongarray.- Parameters:
buffer – The
StringBufferto populate.fieldName – The field name, typically not used as already appended.
array – The array to add to the
toString, notnull.
- @Override protected void appendDetail(StringBuffer buffer, String fieldName, short[] array)[source]
Appends to the
toStringthe detail of ashortarray.- Parameters:
buffer – The
StringBufferto populate.fieldName – The field name, typically not used as already appended.
array – The array to add to the
toString, notnull.
- @Override protected void reflectionAppendArrayDetail(StringBuffer buffer, String fieldName, Object array)[source]
Appends to the
toStringthe detail of an array type.- Parameters:
buffer – The
StringBufferto populate.fieldName – The field name, typically not used as already appended.
array – The array to add to the
toString, notnull.