StandardToStringStyle

public class org.apache.commons.lang3.builder.StandardToStringStyle extends ToStringStyle[source]

Works with 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

Constructors

StandardToStringStyle()

Constructs a new instance.

public StandardToStringStyle()[source]

Constructs a new instance.

Methods

getArrayEnd()

Gets the array end text.

getArraySeparator()

Gets the array separator text.

getArrayStart()

Gets the array start text.

getContentEnd()

Gets the content end text.

getContentStart()

Gets the content start text.

getFieldNameValueSeparator()

Gets the field name value separator text.

getFieldSeparator()

Gets the field separator text.

getNullText()

Gets the text to output when null found.

getSizeEndText()

Gets the end text to output when a Collection, Map or Array size is output.

getSizeStartText()

Gets the text to output when a Collection, Map or Array size is output.

getSummaryObjectEndText()

Gets the end text to output when an Object is output in summary mode.

getSummaryObjectStartText()

Gets the start text to output when an Object is output in summary mode.

isArrayContentDetail()

Tests whether to output array content detail.

isDefaultFullDetail()

Tests whether full detail is used when the caller does not specify a detail level.

isFieldSeparatorAtEnd()

Tests whether the field separator should be added at the end of each buffer.

isFieldSeparatorAtStart()

Tests whether the field separator should be added at the start of each buffer.

isUseClassName()

Tests whether to use the class name.

isUseFieldNames()

Tests whether to use the field names passed in.

isUseIdentityHashCode()

Tests whether to use the identity hash code.

isUseShortClassName()

Tests whether short class names should be output.

setArrayContentDetail(boolean)

Sets whether to output array content detail.

setArrayEnd(String)

Sets the array end text.

setArraySeparator(String)

Sets the array separator text.

setArrayStart(String)

Sets the array start text.

setContentEnd(String)

Sets the content end text.

setContentStart(String)

Sets the content start text.

setDefaultFullDetail(boolean)

Sets whether to use full detail when the caller doesn’t specify.

setFieldNameValueSeparator(String)

Sets the field name value separator text.

setFieldSeparator(String)

Sets the field separator text.

setFieldSeparatorAtEnd(boolean)

Sets whether the field separator should be added at the end of each buffer.

setFieldSeparatorAtStart(boolean)

Sets whether the field separator should be added at the start of each buffer.

setNullText(String)

Sets the text to output when null found.

setSizeEndText(String)

Sets the end text to output when a Collection, Map or Array size is output.

setSizeStartText(String)

Sets the start text to output when a Collection, Map or Array size is output.

setSummaryObjectEndText(String)

Sets the end text to output when an Object is output in summary mode.

setSummaryObjectStartText(String)

Sets the start text to output when an Object is output in summary mode.

setUseClassName(boolean)

Sets whether to use the class name.

setUseFieldNames(boolean)

Sets whether to use the field names passed in.

setUseIdentityHashCode(boolean)

Sets whether to use the identity hash code.

setUseShortClassName(boolean)

Sets whether to output short or long class names.

@Override public String getArrayEnd()[source]

Gets the array end text.

Returns:

The current array end text

@Override public String getArraySeparator()[source]

Gets the array separator text.

Returns:

The current array separator text

@Override public String getArrayStart()[source]

Gets the array start text.

Returns:

The current array start text

@Override public String getContentEnd()[source]

Gets the content end text.

Returns:

The current content end text

@Override public String getContentStart()[source]

Gets the content start text.

Returns:

The current content start text

@Override public String getFieldNameValueSeparator()[source]

Gets the field name value separator text.

Returns:

The current field name value separator text

@Override public String getFieldSeparator()[source]

Gets the field separator text.

Returns:

The current field separator text

@Override public String getNullText()[source]

Gets the text to output when null found.

Returns:

The current text to output when null found

@Override public String getSizeEndText()[source]

Gets the end text to output when a Collection, Map or Array size is output.

This is output after the size value.

Returns:

The current end of size text

@Override public String getSizeStartText()[source]

Gets the text to output when a Collection, Map or Array size is output.

This is output before the size value.

Returns:

The current start of size text

@Override public String getSummaryObjectEndText()[source]

Gets the end text to output when an Object is output in summary mode.

This is output after the size value.

Returns:

The current end of summary text

@Override public String getSummaryObjectStartText()[source]

Gets the start text to output when an Object is output in summary mode.

This is output before the size value.

Returns:

The current start of summary text

@Override public boolean isArrayContentDetail()[source]

Tests whether to output array content detail.

Returns:

The current array content detail setting

@Override public boolean isDefaultFullDetail()[source]

Tests whether full detail is used when the caller does not specify a detail level.

Returns:

The current defaultFullDetail flag

@Override public boolean isFieldSeparatorAtEnd()[source]

Tests whether the field separator should be added at the end of each buffer.

Returns:

fieldSeparatorAtEnd flag

Since:

2.0

@Override public boolean isFieldSeparatorAtStart()[source]

Tests whether the field separator should be added at the start of each buffer.

Returns:

The fieldSeparatorAtStart flag

Since:

2.0

@Override public boolean isUseClassName()[source]

Tests whether to use the class name.

Returns:

The current useClassName flag

@Override public boolean isUseFieldNames()[source]

Tests whether to use the field names passed in.

Returns:

The current useFieldNames flag

@Override public boolean isUseIdentityHashCode()[source]

Tests whether to use the identity hash code.

Returns:

The current useIdentityHashCode flag

@Override public boolean isUseShortClassName()[source]

Tests whether short class names should be output.

Returns:

The current useShortClassName flag

Since:

2.0

@Override public void setArrayContentDetail(boolean arrayContentDetail)[source]

Sets whether to output array content detail.

Parameters:

arrayContentDetail – The new arrayContentDetail flag

@Override public void setArrayEnd(String arrayEnd)[source]

Sets the array end text.

null is accepted, but will be converted to an empty String.

Parameters:

arrayEnd – The new array end text

@Override public void setArraySeparator(String arraySeparator)[source]

Sets the array separator text.

null is accepted, but will be converted to an empty String.

Parameters:

arraySeparator – The new array separator text

@Override public void setArrayStart(String arrayStart)[source]

Sets the array start text.

null is accepted, but will be converted to an empty String.

Parameters:

arrayStart – The new array start text

@Override public void setContentEnd(String contentEnd)[source]

Sets the content end text.

null is accepted, but will be converted to an empty String.

Parameters:

contentEnd – The new content end text

@Override public void setContentStart(String contentStart)[source]

Sets the content start text.

null is accepted, but will be converted to an empty String.

Parameters:

contentStart – The new content start text

@Override public void setDefaultFullDetail(boolean defaultFullDetail)[source]

Sets whether to use full detail when the caller doesn’t specify.

Parameters:

defaultFullDetail – The new defaultFullDetail flag

@Override public void setFieldNameValueSeparator(String fieldNameValueSeparator)[source]

Sets the field name value separator text.

null is accepted, but will be converted to an empty String.

Parameters:

fieldNameValueSeparator – The new field name value separator text

@Override public void setFieldSeparator(String fieldSeparator)[source]

Sets the field separator text.

null is accepted, but will be converted to an empty String.

Parameters:

fieldSeparator – The new field separator text

@Override public void setFieldSeparatorAtEnd(boolean fieldSeparatorAtEnd)[source]

Sets whether the field separator should be added at the end of each buffer.

Parameters:

fieldSeparatorAtEnd – The fieldSeparatorAtEnd flag

Since:

2.0

@Override public void setFieldSeparatorAtStart(boolean fieldSeparatorAtStart)[source]

Sets whether the field separator should be added at the start of each buffer.

Parameters:

fieldSeparatorAtStart – The fieldSeparatorAtStart flag

Since:

2.0

@Override public void setNullText(String nullText)[source]

Sets the text to output when null found.

null is accepted, but will be converted to an empty String.

Parameters:

nullText – The new text to output when null found

@Override public void setSizeEndText(String sizeEndText)[source]

Sets the end text to output when a Collection, Map or Array size is output.

This is output after the size value.

null is accepted, but will be converted to an empty String.

Parameters:

sizeEndText – The new end of size text

@Override public void setSizeStartText(String sizeStartText)[source]

Sets the start text to output when a Collection, Map or Array size is output.

This is output before the size value.

null is accepted, but will be converted to an empty String.

Parameters:

sizeStartText – The new start of size text

@Override public void setSummaryObjectEndText(String summaryObjectEndText)[source]

Sets the end text to output when an Object is output in summary mode.

This is output after the size value.

null is accepted, but will be converted to an empty String.

Parameters:

summaryObjectEndText – The new end of summary text

@Override public void setSummaryObjectStartText(String summaryObjectStartText)[source]

Sets the start text to output when an Object is output in summary mode.

This is output before the size value.

null is accepted, but will be converted to an empty String.

Parameters:

summaryObjectStartText – The new start of summary text

@Override public void setUseClassName(boolean useClassName)[source]

Sets whether to use the class name.

Parameters:

useClassName – The new useClassName flag

@Override public void setUseFieldNames(boolean useFieldNames)[source]

Sets whether to use the field names passed in.

Parameters:

useFieldNames – The new useFieldNames flag

@Override public void setUseIdentityHashCode(boolean useIdentityHashCode)[source]

Sets whether to use the identity hash code.

Parameters:

useIdentityHashCode – The new useIdentityHashCode flag

@Override public void setUseShortClassName(boolean useShortClassName)[source]

Sets whether to output short or long class names.

Parameters:

useShortClassName – The new useShortClassName flag

Since:

2.0