Package org.aoju.bus.core.builder
Class MultilineToStringStyle
java.lang.Object
org.aoju.bus.core.builder.ToStringStyle
org.aoju.bus.core.builder.RecursiveToStringStyle
org.aoju.bus.core.builder.MultilineToStringStyle
- All Implemented Interfaces:
Serializable
使用
ToStringBuilder创建一个“deep”toString。 而是像RecursiveToStringStyle这样的单行,
创建类似ToStringStyle.MULTI_LINE_STYLE的多行字符串。
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();
}
}
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Field Summary
Fields inherited from class org.aoju.bus.core.builder.ToStringStyle
DEFAULT_STYLE, JSON_STYLE, MULTI_LINE_STYLE, NO_CLASS_NAME_STYLE, NO_FIELD_NAMES_STYLE, SHORT_PREFIX_STYLE, SIMPLE_STYLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendDetail(StringBuffer buffer, String fieldName, boolean[] array) Append to thetoStringthe detail of abooleanarray.protected voidappendDetail(StringBuffer buffer, String fieldName, byte[] array) Append to thetoStringthe detail of abytearray.protected voidappendDetail(StringBuffer buffer, String fieldName, char[] array) Append to thetoStringthe detail of achararray.protected voidappendDetail(StringBuffer buffer, String fieldName, double[] array) Append to thetoStringthe detail of adoublearray.protected voidappendDetail(StringBuffer buffer, String fieldName, float[] array) Append to thetoStringthe detail of afloatarray.protected voidappendDetail(StringBuffer buffer, String fieldName, int[] array) Append to thetoStringthe detail of anintarray.protected voidappendDetail(StringBuffer buffer, String fieldName, long[] array) Append to thetoStringthe detail of alongarray.protected voidappendDetail(StringBuffer buffer, String fieldName, short[] array) Append to thetoStringthe detail of ashortarray.voidappendDetail(StringBuffer buffer, String fieldName, Object value) Append to thetoStringanObjectvalue, printing the full detail of theObject.protected voidappendDetail(StringBuffer buffer, String fieldName, Object[] array) Append to thetoStringthe detail of anObjectarray.protected voidreflectionAppendArrayDetail(StringBuffer buffer, String fieldName, Object array) Append to thetoStringthe detail of an array type.Methods inherited from class org.aoju.bus.core.builder.RecursiveToStringStyle
accept, appendDetailMethods inherited from class org.aoju.bus.core.builder.ToStringStyle
append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, appendClassName, appendContentEnd, appendContentStart, appendCyclicObject, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendDetail, appendEnd, appendFieldEnd, appendFieldSeparator, appendFieldStart, appendIdentityHashCode, appendInternal, appendNullText, appendStart, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummary, appendSummarySize, appendSuper, appendToString, getArrayEnd, getArraySeparator, getArrayStart, getContentEnd, getContentStart, getFieldNameValueSeparator, getFieldSeparator, getNullText, getShortClassName, getSizeEndText, getSizeStartText, getSummaryObjectEndText, getSummaryObjectStartText, isArrayContentDetail, isDefaultFullDetail, isFieldSeparatorAtEnd, isFieldSeparatorAtStart, isFullDetail, isUseClassName, isUseFieldNames, isUseIdentityHashCode, isUseShortClassName, removeLastFieldSeparator, setArrayContentDetail, setArrayEnd, setArraySeparator, setArrayStart, setContentEnd, setContentStart, setDefaultFullDetail, setFieldNameValueSeparator, setFieldSeparator, setFieldSeparatorAtEnd, setFieldSeparatorAtStart, setNullText, setSizeEndText, setSizeStartText, setSummaryObjectEndText, setSummaryObjectStartText, setUseClassName, setUseFieldNames, setUseIdentityHashCode, setUseShortClassName
-
Constructor Details
-
MultilineToStringStyle
public MultilineToStringStyle()
-
-
Method Details
-
appendDetail
Description copied from class:ToStringStyleAppend to the
toStringanObjectvalue, printing the full detail of theObject.- Overrides:
appendDetailin classRecursiveToStringStyle- Parameters:
buffer- theStringBufferto populatefieldName- the field name, typically not used as already appendedvalue- the value to add to thetoString, notnull
-
appendDetail
Description copied from class:ToStringStyleAppend to the
toStringthe detail of anObjectarray.- Overrides:
appendDetailin classToStringStyle- Parameters:
buffer- theStringBufferto populatefieldName- the field name, typically not used as already appendedarray- the array to add to thetoString, notnull
-
reflectionAppendArrayDetail
Description copied from class:ToStringStyleAppend to the
toStringthe detail of an array type.- Overrides:
reflectionAppendArrayDetailin classToStringStyle- Parameters:
buffer- theStringBufferto populatefieldName- the field name, typically not used as already appendedarray- the array to add to thetoString, notnull
-
appendDetail
Description copied from class:ToStringStyleAppend to the
toStringthe detail of alongarray.- Overrides:
appendDetailin classToStringStyle- Parameters:
buffer- theStringBufferto populatefieldName- the field name, typically not used as already appendedarray- the array to add to thetoString, notnull
-
appendDetail
Description copied from class:ToStringStyleAppend to the
toStringthe detail of anintarray.- Overrides:
appendDetailin classToStringStyle- Parameters:
buffer- theStringBufferto populatefieldName- the field name, typically not used as already appendedarray- the array to add to thetoString, notnull
-
appendDetail
Description copied from class:ToStringStyleAppend to the
toStringthe detail of ashortarray.- Overrides:
appendDetailin classToStringStyle- Parameters:
buffer- theStringBufferto populatefieldName- the field name, typically not used as already appendedarray- the array to add to thetoString, notnull
-
appendDetail
Description copied from class:ToStringStyleAppend to the
toStringthe detail of abytearray.- Overrides:
appendDetailin classToStringStyle- Parameters:
buffer- theStringBufferto populatefieldName- the field name, typically not used as already appendedarray- the array to add to thetoString, notnull
-
appendDetail
Description copied from class:ToStringStyleAppend to the
toStringthe detail of achararray.- Overrides:
appendDetailin classToStringStyle- Parameters:
buffer- theStringBufferto populatefieldName- the field name, typically not used as already appendedarray- the array to add to thetoString, notnull
-
appendDetail
Description copied from class:ToStringStyleAppend to the
toStringthe detail of adoublearray.- Overrides:
appendDetailin classToStringStyle- Parameters:
buffer- theStringBufferto populatefieldName- the field name, typically not used as already appendedarray- the array to add to thetoString, notnull
-
appendDetail
Description copied from class:ToStringStyleAppend to the
toStringthe detail of afloatarray.- Overrides:
appendDetailin classToStringStyle- Parameters:
buffer- theStringBufferto populatefieldName- the field name, typically not used as already appendedarray- the array to add to thetoString, notnull
-
appendDetail
Description copied from class:ToStringStyleAppend to the
toStringthe detail of abooleanarray.- Overrides:
appendDetailin classToStringStyle- Parameters:
buffer- theStringBufferto populatefieldName- the field name, typically not used as already appendedarray- the array to add to thetoString, notnull
-