Class StandardToStringStyle
- All Implemented Interfaces:
- Serializable
ToStringBuilder to create a toString.
 This class is intended to be used as a singleton. There is no need to instantiate a new style each time. Simply instantiate the class once, customize the values as required, and store the result in a public static final variable for the rest of the program to access.
- Since:
- 1.0
- See Also:
- 
Field SummaryFields inherited from class org.apache.commons.lang3.builder.ToStringStyleDEFAULT_STYLE, JSON_STYLE, MULTI_LINE_STYLE, NO_CLASS_NAME_STYLE, NO_FIELD_NAMES_STYLE, SHORT_PREFIX_STYLE, SIMPLE_STYLE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionGets the array end text.Gets the array separator text.Gets the array start text.Gets the content end text.Gets the content start text.Gets the field name value separator text.Gets the field separator text.Gets the text to output whennullfound.Gets the end text to output when anObjectis output in summary mode.Gets the start text to output when anObjectis output in summary mode.booleanGets whether to output array content detail.booleanGets whether to use full detail when the caller doesn't specify.booleanGets whether the field separator should be added at the end of each buffer.booleanGets whether the field separator should be added at the start of each buffer.booleanGets whether to use the class name.booleanGets whether to use the field names passed in.booleanGets whether to use the identity hash code.booleanGets whether to output short or long class names.voidsetArrayContentDetail(boolean arrayContentDetail) Sets whether to output array content detail.voidsetArrayEnd(String arrayEnd) Sets the array end text.voidsetArraySeparator(String arraySeparator) Sets the array separator text.voidsetArrayStart(String arrayStart) Sets the array start text.voidsetContentEnd(String contentEnd) Sets the content end text.voidsetContentStart(String contentStart) Sets the content start text.voidsetDefaultFullDetail(boolean defaultFullDetail) Sets whether to use full detail when the caller doesn't specify.voidsetFieldNameValueSeparator(String fieldNameValueSeparator) Sets the field name value separator text.voidsetFieldSeparator(String fieldSeparator) Sets the field separator text.voidsetFieldSeparatorAtEnd(boolean fieldSeparatorAtEnd) Sets whether the field separator should be added at the end of each buffer.voidsetFieldSeparatorAtStart(boolean fieldSeparatorAtStart) Sets whether the field separator should be added at the start of each buffer.voidsetNullText(String nullText) Sets the text to output whennullfound.voidsetSizeEndText(String sizeEndText) voidsetSizeStartText(String sizeStartText) voidsetSummaryObjectEndText(String summaryObjectEndText) Sets the end text to output when anObjectis output in summary mode.voidsetSummaryObjectStartText(String summaryObjectStartText) Sets the start text to output when anObjectis output in summary mode.voidsetUseClassName(boolean useClassName) Sets whether to use the class name.voidsetUseFieldNames(boolean useFieldNames) Sets whether to use the field names passed in.voidsetUseIdentityHashCode(boolean useIdentityHashCode) Sets whether to use the identity hash code.voidsetUseShortClassName(boolean useShortClassName) Sets whether to output short or long class names.Methods inherited from class org.apache.commons.lang3.builder.ToStringStyleappend, 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, appendDetail, appendDetail, appendDetail, 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, getRegistry, getShortClassName, isFullDetail, reflectionAppendArrayDetail, removeLastFieldSeparator
- 
Constructor Details- 
StandardToStringStylepublic StandardToStringStyle()Constructs a new instance.
 
- 
- 
Method Details- 
getArrayEndGets the array end text.- Overrides:
- getArrayEndin class- ToStringStyle
- Returns:
- the current array end text
 
- 
getArraySeparatorGets the array separator text.- Overrides:
- getArraySeparatorin class- ToStringStyle
- Returns:
- the current array separator text
 
- 
getArrayStartGets the array start text.- Overrides:
- getArrayStartin class- ToStringStyle
- Returns:
- the current array start text
 
- 
getContentEndGets the content end text.- Overrides:
- getContentEndin class- ToStringStyle
- Returns:
- the current content end text
 
- 
getContentStartGets the content start text.- Overrides:
- getContentStartin class- ToStringStyle
- Returns:
- the current content start text
 
- 
getFieldNameValueSeparatorGets the field name value separator text.- Overrides:
- getFieldNameValueSeparatorin class- ToStringStyle
- Returns:
- the current field name value separator text
 
- 
getFieldSeparatorGets the field separator text.- Overrides:
- getFieldSeparatorin class- ToStringStyle
- Returns:
- the current field separator text
 
- 
getNullTextGets the text to output whennullfound.- Overrides:
- getNullTextin class- ToStringStyle
- Returns:
- the current text to output when nullfound
 
- 
getSizeEndTextGets the end text to output when aCollection,MaporArraysize is output.This is output after the size value. - Overrides:
- getSizeEndTextin class- ToStringStyle
- Returns:
- the current end of size text
 
- 
getSizeStartTextGets the text to output when aCollection,MaporArraysize is output.This is output before the size value. - Overrides:
- getSizeStartTextin class- ToStringStyle
- Returns:
- the current start of size text
 
- 
getSummaryObjectEndTextGets the end text to output when anObjectis output in summary mode.This is output after the size value. - Overrides:
- getSummaryObjectEndTextin class- ToStringStyle
- Returns:
- the current end of summary text
 
- 
getSummaryObjectStartTextGets the start text to output when anObjectis output in summary mode.This is output before the size value. - Overrides:
- getSummaryObjectStartTextin class- ToStringStyle
- Returns:
- the current start of summary text
 
- 
isArrayContentDetailGets whether to output array content detail.- Overrides:
- isArrayContentDetailin class- ToStringStyle
- Returns:
- the current array content detail setting
 
- 
isDefaultFullDetailGets whether to use full detail when the caller doesn't specify.- Overrides:
- isDefaultFullDetailin class- ToStringStyle
- Returns:
- the current defaultFullDetail flag
 
- 
isFieldSeparatorAtEndGets whether the field separator should be added at the end of each buffer.- Overrides:
- isFieldSeparatorAtEndin class- ToStringStyle
- Returns:
- fieldSeparatorAtEnd flag
- Since:
- 2.0
 
- 
isFieldSeparatorAtStartGets whether the field separator should be added at the start of each buffer.- Overrides:
- isFieldSeparatorAtStartin class- ToStringStyle
- Returns:
- the fieldSeparatorAtStart flag
- Since:
- 2.0
 
- 
isUseClassNameGets whether to use the class name.- Overrides:
- isUseClassNamein class- ToStringStyle
- Returns:
- the current useClassName flag
 
- 
isUseFieldNamesGets whether to use the field names passed in.- Overrides:
- isUseFieldNamesin class- ToStringStyle
- Returns:
- the current useFieldNames flag
 
- 
isUseIdentityHashCodeGets whether to use the identity hash code.- Overrides:
- isUseIdentityHashCodein class- ToStringStyle
- Returns:
- the current useIdentityHashCode flag
 
- 
isUseShortClassNameGets whether to output short or long class names.- Overrides:
- isUseShortClassNamein class- ToStringStyle
- Returns:
- the current useShortClassName flag
- Since:
- 2.0
 
- 
setArrayContentDetailSets whether to output array content detail.- Overrides:
- setArrayContentDetailin class- ToStringStyle
- Parameters:
- arrayContentDetail- the new arrayContentDetail flag
 
- 
setArrayEndSets the array end text.nullis accepted, but will be converted to an empty String.- Overrides:
- setArrayEndin class- ToStringStyle
- Parameters:
- arrayEnd- the new array end text
 
- 
setArraySeparatorSets the array separator text.nullis accepted, but will be converted to an empty String.- Overrides:
- setArraySeparatorin class- ToStringStyle
- Parameters:
- arraySeparator- the new array separator text
 
- 
setArrayStartSets the array start text.nullis accepted, but will be converted to an empty String.- Overrides:
- setArrayStartin class- ToStringStyle
- Parameters:
- arrayStart- the new array start text
 
- 
setContentEndSets the content end text.nullis accepted, but will be converted to an empty String.- Overrides:
- setContentEndin class- ToStringStyle
- Parameters:
- contentEnd- the new content end text
 
- 
setContentStartSets the content start text.nullis accepted, but will be converted to an empty String.- Overrides:
- setContentStartin class- ToStringStyle
- Parameters:
- contentStart- the new content start text
 
- 
setDefaultFullDetailSets whether to use full detail when the caller doesn't specify.- Overrides:
- setDefaultFullDetailin class- ToStringStyle
- Parameters:
- defaultFullDetail- the new defaultFullDetail flag
 
- 
setFieldNameValueSeparatorSets the field name value separator text.nullis accepted, but will be converted to an empty String.- Overrides:
- setFieldNameValueSeparatorin class- ToStringStyle
- Parameters:
- fieldNameValueSeparator- the new field name value separator text
 
- 
setFieldSeparatorSets the field separator text.nullis accepted, but will be converted to an empty String.- Overrides:
- setFieldSeparatorin class- ToStringStyle
- Parameters:
- fieldSeparator- the new field separator text
 
- 
setFieldSeparatorAtEndSets whether the field separator should be added at the end of each buffer.- Overrides:
- setFieldSeparatorAtEndin class- ToStringStyle
- Parameters:
- fieldSeparatorAtEnd- the fieldSeparatorAtEnd flag
- Since:
- 2.0
 
- 
setFieldSeparatorAtStartSets whether the field separator should be added at the start of each buffer.- Overrides:
- setFieldSeparatorAtStartin class- ToStringStyle
- Parameters:
- fieldSeparatorAtStart- the fieldSeparatorAtStart flag
- Since:
- 2.0
 
- 
setNullTextSets the text to output whennullfound.nullis accepted, but will be converted to an empty String.- Overrides:
- setNullTextin class- ToStringStyle
- Parameters:
- nullText- the new text to output when- nullfound
 
- 
setSizeEndTextSets the end text to output when aCollection,MaporArraysize is output.This is output after the size value. nullis accepted, but will be converted to an empty String.- Overrides:
- setSizeEndTextin class- ToStringStyle
- Parameters:
- sizeEndText- the new end of size text
 
- 
setSizeStartTextSets the start text to output when aCollection,MaporArraysize is output.This is output before the size value. nullis accepted, but will be converted to an empty String.- Overrides:
- setSizeStartTextin class- ToStringStyle
- Parameters:
- sizeStartText- the new start of size text
 
- 
setSummaryObjectEndTextSets the end text to output when anObjectis output in summary mode.This is output after the size value. nullis accepted, but will be converted to an empty String.- Overrides:
- setSummaryObjectEndTextin class- ToStringStyle
- Parameters:
- summaryObjectEndText- the new end of summary text
 
- 
setSummaryObjectStartTextSets the start text to output when anObjectis output in summary mode.This is output before the size value. nullis accepted, but will be converted to an empty String.- Overrides:
- setSummaryObjectStartTextin class- ToStringStyle
- Parameters:
- summaryObjectStartText- the new start of summary text
 
- 
setUseClassNameSets whether to use the class name.- Overrides:
- setUseClassNamein class- ToStringStyle
- Parameters:
- useClassName- the new useClassName flag
 
- 
setUseFieldNamesSets whether to use the field names passed in.- Overrides:
- setUseFieldNamesin class- ToStringStyle
- Parameters:
- useFieldNames- the new useFieldNames flag
 
- 
setUseIdentityHashCodeSets whether to use the identity hash code.- Overrides:
- setUseIdentityHashCodein class- ToStringStyle
- Parameters:
- useIdentityHashCode- the new useIdentityHashCode flag
 
- 
setUseShortClassNameSets whether to output short or long class names.- Overrides:
- setUseShortClassNamein class- ToStringStyle
- Parameters:
- useShortClassName- the new useShortClassName flag
- Since:
- 2.0
 
 
-