Top Description Fields Constructors Methods
org.apache.commons.lang3.builder

public Class StandardToStringStyle

extends ToStringStyle
Class Inheritance
Imports
java.lang.reflect.Array, java.util.Collection, .Map

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

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from org.apache.commons.lang3.builder.ToStringStyle:
DEFAULT_STYLEJSON_STYLEMULTI_LINE_STYLENO_CLASS_NAME_STYLENO_FIELD_NAMES_STYLESHORT_PREFIX_STYLESIMPLE_STYLE

Constructor Summary

AccessConstructor and Description
public
StandardToStringStyle()

Constructs a new instance.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the current array end text
getArrayEnd
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getArrayEnd.

Gets the array end text.

public String

Returns:

the current array separator text
getArraySeparator
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getArraySeparator.

Gets the array separator text.

public String

Returns:

the current array start text
getArrayStart
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getArrayStart.

Gets the array start text.

public String

Returns:

the current content end text
getContentEnd
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getContentEnd.

Gets the content end text.

public String

Returns:

the current content start text
getContentStart
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getContentStart.

Gets the content start text.

public String

Returns:

the current field name value separator text
getFieldNameValueSeparator
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getFieldNameValueSeparator.

Gets the field name value separator text.

public String

Returns:

the current field separator text
getFieldSeparator
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getFieldSeparator.

Gets the field separator text.

public String

Returns:

the current text to output when null found
getNullText
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getNullText.

Gets the text to output when null found.

public String

Returns:

the current end of size text
getSizeEndText
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getSizeEndText.

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

public String

Returns:

the current start of size text
getSizeStartText
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getSizeStartText.

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

public String

Returns:

the current end of summary text
getSummaryObjectEndText
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getSummaryObjectEndText.

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

public String

Returns:

the current start of summary text
getSummaryObjectStartText
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getSummaryObjectStartText.

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

public boolean

Returns:

the current array content detail setting
isArrayContentDetail
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isArrayContentDetail.

Gets whether to output array content detail.

public boolean

Returns:

the current defaultFullDetail flag
isDefaultFullDetail
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isDefaultFullDetail.

Gets whether to use full detail when the caller doesn't specify.

public boolean

Returns:

fieldSeparatorAtEnd flag
isFieldSeparatorAtEnd
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isFieldSeparatorAtEnd.

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

public boolean

Returns:

the fieldSeparatorAtStart flag
isFieldSeparatorAtStart
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isFieldSeparatorAtStart.

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

public boolean

Returns:

the current useClassName flag
isUseClassName
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isUseClassName.

Gets whether to use the class name.

public boolean

Returns:

the current useFieldNames flag
isUseFieldNames
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isUseFieldNames.

Gets whether to use the field names passed in.

public boolean

Returns:

the current useIdentityHashCode flag
isUseIdentityHashCode
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isUseIdentityHashCode.

Gets whether to use the identity hash code.

public boolean

Returns:

the current useShortClassName flag
isUseShortClassName
()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isUseShortClassName.

Gets whether to output short or long class names.

public void
setArrayContentDetail(final boolean
the new arrayContentDetail flag
arrayContentDetail
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setArrayContentDetail.

Sets whether to output array content detail.

public void
setArrayEnd(final String
the new array end text
arrayEnd
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setArrayEnd.

Sets the array end text.

public void
setArraySeparator(final String
the new array separator text
arraySeparator
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setArraySeparator.

Sets the array separator text.

public void
setArrayStart(final String
the new array start text
arrayStart
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setArrayStart.

Sets the array start text.

public void
setContentEnd(final String
the new content end text
contentEnd
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setContentEnd.

Sets the content end text.

public void
setContentStart(final String
the new content start text
contentStart
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setContentStart.

Sets the content start text.

public void
setDefaultFullDetail(final boolean
the new defaultFullDetail flag
defaultFullDetail
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setDefaultFullDetail.

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

public void
setFieldNameValueSeparator(final String
the new field name value separator text
fieldNameValueSeparator
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setFieldNameValueSeparator.

Sets the field name value separator text.

public void
setFieldSeparator(final String
the new field separator text
fieldSeparator
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setFieldSeparator.

Sets the field separator text.

public void
setFieldSeparatorAtEnd(final boolean
the fieldSeparatorAtEnd flag
fieldSeparatorAtEnd
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setFieldSeparatorAtEnd.

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

public void
setFieldSeparatorAtStart(final boolean
the fieldSeparatorAtStart flag
fieldSeparatorAtStart
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setFieldSeparatorAtStart.

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

public void
setNullText(final String
the new text to output when null found
nullText
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setNullText.

Sets the text to output when null found.

public void
setSizeEndText(final String
the new end of size text
sizeEndText
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setSizeEndText.

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

public void
setSizeStartText(final String
the new start of size text
sizeStartText
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setSizeStartText.

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

public void
setSummaryObjectEndText(final String
the new end of summary text
summaryObjectEndText
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setSummaryObjectEndText.

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

public void
setSummaryObjectStartText(final String
the new start of summary text
summaryObjectStartText
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setSummaryObjectStartText.

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

public void
setUseClassName(final boolean
the new useClassName flag
useClassName
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setUseClassName.

Sets whether to use the class name.

public void
setUseFieldNames(final boolean
the new useFieldNames flag
useFieldNames
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setUseFieldNames.

Sets whether to use the field names passed in.

public void
setUseIdentityHashCode(final boolean
the new useIdentityHashCode flag
useIdentityHashCode
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setUseIdentityHashCode.

Sets whether to use the identity hash code.

public void
setUseShortClassName(final boolean
the new useShortClassName flag
useShortClassName
)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setUseShortClassName.

Sets whether to output short or long class names.

Inherited from org.apache.commons.lang3.builder.ToStringStyle:
appendappendappendappendappendappendappendappendappendappendappendappendappendappendappendappendappendappendappendClassNameappendContentEndappendContentStartappendCyclicObjectappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendDetailappendEndappendFieldEndappendFieldSeparatorappendFieldStartappendIdentityHashCodeappendInternalappendNullTextappendStartappendSummaryappendSummaryappendSummaryappendSummaryappendSummaryappendSummaryappendSummaryappendSummaryappendSummaryappendSummaryappendSummarySizeappendSuperappendToStringgetRegistrygetShortClassNameisFullDetailisRegisteredreflectionAppendArrayDetailregisterremoveLastFieldSeparatorunregister

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.commons.lang3.builder.ToStringStyle.serialVersionUID.

Required for serialization support.

See Also
java.io.Serializable

Constructor Detail

StandardToStringStyleback to summary
public StandardToStringStyle()

Constructs a new instance.

Method Detail

getArrayEndback to summary
public String getArrayEnd()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getArrayEnd.

Gets the array end text.

Returns:String

the current array end text

Annotations
@Override
getArraySeparatorback to summary
public String getArraySeparator()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getArraySeparator.

Gets the array separator text.

Returns:String

the current array separator text

Annotations
@Override
getArrayStartback to summary
public String getArrayStart()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getArrayStart.

Gets the array start text.

Returns:String

the current array start text

Annotations
@Override
getContentEndback to summary
public String getContentEnd()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getContentEnd.

Gets the content end text.

Returns:String

the current content end text

Annotations
@Override
getContentStartback to summary
public String getContentStart()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getContentStart.

Gets the content start text.

Returns:String

the current content start text

Annotations
@Override
getFieldNameValueSeparatorback to summary
public String getFieldNameValueSeparator()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getFieldNameValueSeparator.

Gets the field name value separator text.

Returns:String

the current field name value separator text

Annotations
@Override
getFieldSeparatorback to summary
public String getFieldSeparator()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getFieldSeparator.

Gets the field separator text.

Returns:String

the current field separator text

Annotations
@Override
getNullTextback to summary
public String getNullText()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getNullText.

Gets the text to output when null found.

Returns:String

the current text to output when null found

Annotations
@Override
getSizeEndTextback to summary
public String getSizeEndText()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getSizeEndText.

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

This is output after the size value.

Returns:String

the current end of size text

Annotations
@Override
getSizeStartTextback to summary
public String getSizeStartText()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getSizeStartText.

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

This is output before the size value.

Returns:String

the current start of size text

Annotations
@Override
getSummaryObjectEndTextback to summary
public String getSummaryObjectEndText()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getSummaryObjectEndText.

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

This is output after the size value.

Returns:String

the current end of summary text

Annotations
@Override
getSummaryObjectStartTextback to summary
public String getSummaryObjectStartText()

Overrides org.apache.commons.lang3.builder.ToStringStyle.getSummaryObjectStartText.

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

This is output before the size value.

Returns:String

the current start of summary text

Annotations
@Override
isArrayContentDetailback to summary
public boolean isArrayContentDetail()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isArrayContentDetail.

Gets whether to output array content detail.

Returns:boolean

the current array content detail setting

Annotations
@Override
isDefaultFullDetailback to summary
public boolean isDefaultFullDetail()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isDefaultFullDetail.

Gets whether to use full detail when the caller doesn't specify.

Returns:boolean

the current defaultFullDetail flag

Annotations
@Override
isFieldSeparatorAtEndback to summary
public boolean isFieldSeparatorAtEnd()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isFieldSeparatorAtEnd.

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

Returns:boolean

fieldSeparatorAtEnd flag

Annotations
@Override
Since
2.0
isFieldSeparatorAtStartback to summary
public boolean isFieldSeparatorAtStart()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isFieldSeparatorAtStart.

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

Returns:boolean

the fieldSeparatorAtStart flag

Annotations
@Override
Since
2.0
isUseClassNameback to summary
public boolean isUseClassName()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isUseClassName.

Gets whether to use the class name.

Returns:boolean

the current useClassName flag

Annotations
@Override
isUseFieldNamesback to summary
public boolean isUseFieldNames()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isUseFieldNames.

Gets whether to use the field names passed in.

Returns:boolean

the current useFieldNames flag

Annotations
@Override
isUseIdentityHashCodeback to summary
public boolean isUseIdentityHashCode()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isUseIdentityHashCode.

Gets whether to use the identity hash code.

Returns:boolean

the current useIdentityHashCode flag

Annotations
@Override
isUseShortClassNameback to summary
public boolean isUseShortClassName()

Overrides org.apache.commons.lang3.builder.ToStringStyle.isUseShortClassName.

Gets whether to output short or long class names.

Returns:boolean

the current useShortClassName flag

Annotations
@Override
Since
2.0
setArrayContentDetailback to summary
public void setArrayContentDetail(final boolean arrayContentDetail)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setArrayContentDetail.

Sets whether to output array content detail.

Parameters
arrayContentDetail:boolean

the new arrayContentDetail flag

Annotations
@Override
setArrayEndback to summary
public void setArrayEnd(final String arrayEnd)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setArrayEnd.

Sets the array end text.

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

Parameters
arrayEnd:String

the new array end text

Annotations
@Override
setArraySeparatorback to summary
public void setArraySeparator(final String arraySeparator)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setArraySeparator.

Sets the array separator text.

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

Parameters
arraySeparator:String

the new array separator text

Annotations
@Override
setArrayStartback to summary
public void setArrayStart(final String arrayStart)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setArrayStart.

Sets the array start text.

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

Parameters
arrayStart:String

the new array start text

Annotations
@Override
setContentEndback to summary
public void setContentEnd(final String contentEnd)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setContentEnd.

Sets the content end text.

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

Parameters
contentEnd:String

the new content end text

Annotations
@Override
setContentStartback to summary
public void setContentStart(final String contentStart)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setContentStart.

Sets the content start text.

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

Parameters
contentStart:String

the new content start text

Annotations
@Override
setDefaultFullDetailback to summary
public void setDefaultFullDetail(final boolean defaultFullDetail)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setDefaultFullDetail.

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

Parameters
defaultFullDetail:boolean

the new defaultFullDetail flag

Annotations
@Override
setFieldNameValueSeparatorback to summary
public void setFieldNameValueSeparator(final String fieldNameValueSeparator)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setFieldNameValueSeparator.

Sets the field name value separator text.

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

Parameters
fieldNameValueSeparator:String

the new field name value separator text

Annotations
@Override
setFieldSeparatorback to summary
public void setFieldSeparator(final String fieldSeparator)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setFieldSeparator.

Sets the field separator text.

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

Parameters
fieldSeparator:String

the new field separator text

Annotations
@Override
setFieldSeparatorAtEndback to summary
public void setFieldSeparatorAtEnd(final boolean fieldSeparatorAtEnd)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setFieldSeparatorAtEnd.

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

Parameters
fieldSeparatorAtEnd:boolean

the fieldSeparatorAtEnd flag

Annotations
@Override
Since
2.0
setFieldSeparatorAtStartback to summary
public void setFieldSeparatorAtStart(final boolean fieldSeparatorAtStart)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setFieldSeparatorAtStart.

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

Parameters
fieldSeparatorAtStart:boolean

the fieldSeparatorAtStart flag

Annotations
@Override
Since
2.0
setNullTextback to summary
public void setNullText(final String nullText)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setNullText.

Sets the text to output when null found.

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

Parameters
nullText:String

the new text to output when null found

Annotations
@Override
setSizeEndTextback to summary
public void setSizeEndText(final String sizeEndText)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setSizeEndText.

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:String

the new end of size text

Annotations
@Override
setSizeStartTextback to summary
public void setSizeStartText(final String sizeStartText)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setSizeStartText.

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:String

the new start of size text

Annotations
@Override
setSummaryObjectEndTextback to summary
public void setSummaryObjectEndText(final String summaryObjectEndText)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setSummaryObjectEndText.

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:String

the new end of summary text

Annotations
@Override
setSummaryObjectStartTextback to summary
public void setSummaryObjectStartText(final String summaryObjectStartText)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setSummaryObjectStartText.

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:String

the new start of summary text

Annotations
@Override
setUseClassNameback to summary
public void setUseClassName(final boolean useClassName)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setUseClassName.

Sets whether to use the class name.

Parameters
useClassName:boolean

the new useClassName flag

Annotations
@Override
setUseFieldNamesback to summary
public void setUseFieldNames(final boolean useFieldNames)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setUseFieldNames.

Sets whether to use the field names passed in.

Parameters
useFieldNames:boolean

the new useFieldNames flag

Annotations
@Override
setUseIdentityHashCodeback to summary
public void setUseIdentityHashCode(final boolean useIdentityHashCode)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setUseIdentityHashCode.

Sets whether to use the identity hash code.

Parameters
useIdentityHashCode:boolean

the new useIdentityHashCode flag

Annotations
@Override
setUseShortClassNameback to summary
public void setUseShortClassName(final boolean useShortClassName)

Overrides org.apache.commons.lang3.builder.ToStringStyle.setUseShortClassName.

Sets whether to output short or long class names.

Parameters
useShortClassName:boolean

the new useShortClassName flag

Annotations
@Override
Since
2.0