StandardToStringStyle¶
- public class org.apache.commons.lang3.builder.StandardToStringStyle extends ToStringStyle[source]¶
Works with
ToStringBuilderto create atoString.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
Constructors¶
Constructs a new instance. |
Methods¶
Gets 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 when |
||
Gets the end text to output when a |
||
Gets the text to output when a |
||
Gets the end text to output when an |
||
Gets the start text to output when an |
||
|
Tests whether to output array content detail. |
|
|
Tests whether full detail is used when the caller does not specify a detail level. |
|
|
Tests whether the field separator should be added at the end of each buffer. |
|
|
Tests whether the field separator should be added at the start of each buffer. |
|
|
Tests whether to use the class name. |
|
|
Tests whether to use the field names passed in. |
|
|
Tests whether to use the identity hash code. |
|
|
Tests whether short class names should be output. |
|
|
Sets whether to output array content detail. |
|
|
Sets the array end text. |
|
|
Sets the array separator text. |
|
|
Sets the array start text. |
|
|
Sets the content end text. |
|
|
Sets the content start text. |
|
|
Sets whether to use full detail when the caller doesn't specify. |
|
|
Sets the field name value separator text. |
|
|
Sets the field separator text. |
|
|
Sets whether the field separator should be added at the end of each buffer. |
|
|
Sets whether the field separator should be added at the start of each buffer. |
|
|
Sets the text to output when |
|
|
Sets the end text to output when a |
|
|
Sets the start text to output when a |
|
|
Sets the end text to output when an |
|
|
Sets the start text to output when an |
|
|
Sets whether to use the class name. |
|
|
Sets whether to use the field names passed in. |
|
|
Sets whether to use the identity hash code. |
|
|
Sets whether to output short or long class names. |
- public String getArrayEnd()[source]¶
Gets the array end text.
- Overrides:
getArrayEndin classToStringStyle- Returns:
The current array end text
- public String getArraySeparator()[source]¶
Gets the array separator text.
- Overrides:
getArraySeparatorin classToStringStyle- Returns:
The current array separator text
- public String getArrayStart()[source]¶
Gets the array start text.
- Overrides:
getArrayStartin classToStringStyle- Returns:
The current array start text
- public String getContentEnd()[source]¶
Gets the content end text.
- Overrides:
getContentEndin classToStringStyle- Returns:
The current content end text
- public String getContentStart()[source]¶
Gets the content start text.
- Overrides:
getContentStartin classToStringStyle- Returns:
The current content start text
- public String getFieldNameValueSeparator()[source]¶
Gets the field name value separator text.
- Overrides:
getFieldNameValueSeparatorin classToStringStyle- Returns:
The current field name value separator text
- public String getFieldSeparator()[source]¶
Gets the field separator text.
- Overrides:
getFieldSeparatorin classToStringStyle- Returns:
The current field separator text
- public String getNullText()[source]¶
Gets the text to output when
nullfound.- Overrides:
getNullTextin classToStringStyle- Returns:
The current text to output when
nullfound
- public String getSizeEndText()[source]¶
Gets the end text to output when a
Collection,MaporArraysize is output.This is output after the size value.
- Overrides:
getSizeEndTextin classToStringStyle- Returns:
The current end of size text
- public String getSizeStartText()[source]¶
Gets the text to output when a
Collection,MaporArraysize is output.This is output before the size value.
- Overrides:
getSizeStartTextin classToStringStyle- Returns:
The current start of size text
- public String getSummaryObjectEndText()[source]¶
Gets the end text to output when an
Objectis output in summary mode.This is output after the size value.
- Overrides:
getSummaryObjectEndTextin classToStringStyle- Returns:
The current end of summary text
- public String getSummaryObjectStartText()[source]¶
Gets the start text to output when an
Objectis output in summary mode.This is output before the size value.
- Overrides:
getSummaryObjectStartTextin classToStringStyle- Returns:
The current start of summary text
- public boolean isArrayContentDetail()[source]¶
Tests whether to output array content detail.
- Overrides:
isArrayContentDetailin classToStringStyle- Returns:
The current array content detail setting
- public boolean isDefaultFullDetail()[source]¶
Tests whether full detail is used when the caller does not specify a detail level.
- Overrides:
isDefaultFullDetailin classToStringStyle- Returns:
The current defaultFullDetail flag
- public boolean isFieldSeparatorAtEnd()[source]¶
Tests whether the field separator should be added at the end of each buffer.
- Overrides:
isFieldSeparatorAtEndin classToStringStyle- Returns:
fieldSeparatorAtEnd flag
- Since:
2.0
- public boolean isFieldSeparatorAtStart()[source]¶
Tests whether the field separator should be added at the start of each buffer.
- Overrides:
isFieldSeparatorAtStartin classToStringStyle- Returns:
The fieldSeparatorAtStart flag
- Since:
2.0
- public boolean isUseClassName()[source]¶
Tests whether to use the class name.
- Overrides:
isUseClassNamein classToStringStyle- Returns:
The current useClassName flag
- public boolean isUseFieldNames()[source]¶
Tests whether to use the field names passed in.
- Overrides:
isUseFieldNamesin classToStringStyle- Returns:
The current useFieldNames flag
- public boolean isUseIdentityHashCode()[source]¶
Tests whether to use the identity hash code.
- Overrides:
isUseIdentityHashCodein classToStringStyle- Returns:
The current useIdentityHashCode flag
- public boolean isUseShortClassName()[source]¶
Tests whether short class names should be output.
- Overrides:
isUseShortClassNamein classToStringStyle- Returns:
The current useShortClassName flag
- Since:
2.0
- public void setArrayContentDetail(boolean arrayContentDetail)[source]¶
Sets whether to output array content detail.
- Overrides:
setArrayContentDetailin classToStringStyle- Parameters:
arrayContentDetail – The new arrayContentDetail flag
- public void setArrayEnd(String arrayEnd)[source]¶
Sets the array end text.
nullis accepted, but will be converted to an empty String.- Overrides:
setArrayEndin classToStringStyle- Parameters:
arrayEnd – The new array end text
- public void setArraySeparator(String arraySeparator)[source]¶
Sets the array separator text.
nullis accepted, but will be converted to an empty String.- Overrides:
setArraySeparatorin classToStringStyle- Parameters:
arraySeparator – The new array separator text
- public void setArrayStart(String arrayStart)[source]¶
Sets the array start text.
nullis accepted, but will be converted to an empty String.- Overrides:
setArrayStartin classToStringStyle- Parameters:
arrayStart – The new array start text
- public void setContentEnd(String contentEnd)[source]¶
Sets the content end text.
nullis accepted, but will be converted to an empty String.- Overrides:
setContentEndin classToStringStyle- Parameters:
contentEnd – The new content end text
- public void setContentStart(String contentStart)[source]¶
Sets the content start text.
nullis accepted, but will be converted to an empty String.- Overrides:
setContentStartin classToStringStyle- Parameters:
contentStart – The new content start text
- public void setDefaultFullDetail(boolean defaultFullDetail)[source]¶
Sets whether to use full detail when the caller doesn't specify.
- Overrides:
setDefaultFullDetailin classToStringStyle- Parameters:
defaultFullDetail – The new defaultFullDetail flag
- public void setFieldNameValueSeparator(String fieldNameValueSeparator)[source]¶
Sets the field name value separator text.
nullis accepted, but will be converted to an empty String.- Overrides:
setFieldNameValueSeparatorin classToStringStyle- Parameters:
fieldNameValueSeparator – The new field name value separator text
- public void setFieldSeparator(String fieldSeparator)[source]¶
Sets the field separator text.
nullis accepted, but will be converted to an empty String.- Overrides:
setFieldSeparatorin classToStringStyle- Parameters:
fieldSeparator – The new field separator text
- public void setFieldSeparatorAtEnd(boolean fieldSeparatorAtEnd)[source]¶
Sets whether the field separator should be added at the end of each buffer.
- Overrides:
setFieldSeparatorAtEndin classToStringStyle- Parameters:
fieldSeparatorAtEnd – The fieldSeparatorAtEnd flag
- Since:
2.0
- public void setFieldSeparatorAtStart(boolean fieldSeparatorAtStart)[source]¶
Sets whether the field separator should be added at the start of each buffer.
- Overrides:
setFieldSeparatorAtStartin classToStringStyle- Parameters:
fieldSeparatorAtStart – The fieldSeparatorAtStart flag
- Since:
2.0
- public void setNullText(String nullText)[source]¶
Sets the text to output when
nullfound.nullis accepted, but will be converted to an empty String.- Overrides:
setNullTextin classToStringStyle- Parameters:
nullText – The new text to output when
nullfound
- public void setSizeEndText(String sizeEndText)[source]¶
Sets the end text to output when a
Collection,MaporArraysize is output.This is output after the size value.
nullis accepted, but will be converted to an empty String.- Overrides:
setSizeEndTextin classToStringStyle- Parameters:
sizeEndText – The new end of size text
- public void setSizeStartText(String sizeStartText)[source]¶
Sets the start text to output when a
Collection,MaporArraysize is output.This is output before the size value.
nullis accepted, but will be converted to an empty String.- Overrides:
setSizeStartTextin classToStringStyle- Parameters:
sizeStartText – The new start of size text
- public void setSummaryObjectEndText(String summaryObjectEndText)[source]¶
Sets the end text to output when an
Objectis output in summary mode.This is output after the size value.
nullis accepted, but will be converted to an empty String.- Overrides:
setSummaryObjectEndTextin classToStringStyle- Parameters:
summaryObjectEndText – The new end of summary text
- public void setSummaryObjectStartText(String summaryObjectStartText)[source]¶
Sets the start text to output when an
Objectis output in summary mode.This is output before the size value.
nullis accepted, but will be converted to an empty String.- Overrides:
setSummaryObjectStartTextin classToStringStyle- Parameters:
summaryObjectStartText – The new start of summary text
- public void setUseClassName(boolean useClassName)[source]¶
Sets whether to use the class name.
- Overrides:
setUseClassNamein classToStringStyle- Parameters:
useClassName – The new useClassName flag
- public void setUseFieldNames(boolean useFieldNames)[source]¶
Sets whether to use the field names passed in.
- Overrides:
setUseFieldNamesin classToStringStyle- Parameters:
useFieldNames – The new useFieldNames flag
- public void setUseIdentityHashCode(boolean useIdentityHashCode)[source]¶
Sets whether to use the identity hash code.
- Overrides:
setUseIdentityHashCodein classToStringStyle- Parameters:
useIdentityHashCode – The new useIdentityHashCode flag
- public void setUseShortClassName(boolean useShortClassName)[source]¶
Sets whether to output short or long class names.
- Overrides:
setUseShortClassNamein classToStringStyle- Parameters:
useShortClassName – The new useShortClassName flag
- Since:
2.0