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.
getArrayEnd
public String getArrayEnd()
Gets the array end text.
- getArrayEnd in interface ToStringStyle
- the current array end text
getArraySeparator
public String getArraySeparator()
Gets the array separator text.
- getArraySeparator in interface ToStringStyle
- the current array separator text
getArrayStart
public String getArrayStart()
Gets the array start text.
- getArrayStart in interface ToStringStyle
- the current array start text
getContentEnd
public String getContentEnd()
Gets the content end text.
- getContentEnd in interface ToStringStyle
- the current content end text
getContentStart
public String getContentStart()
Gets the content start text.
- getContentStart in interface ToStringStyle
- the current content start text
getFieldNameValueSeparator
public String getFieldNameValueSeparator()
Gets the field name value separator text.
- getFieldNameValueSeparator in interface ToStringStyle
- the current field name value separator text
getFieldSeparator
public String getFieldSeparator()
Gets the field separator text.
- getFieldSeparator in interface ToStringStyle
- the current field separator text
getNullText
public String getNullText()
Gets the text to output when null
found.
- getNullText in interface ToStringStyle
- the current text to output when
null
found
getSizeEndText
public String getSizeEndText()
Gets the end text to output when a
Collection
,
Map
or
Array
size is output.
This is output after the size value.
- getSizeEndText in interface ToStringStyle
- the current end of size text
getSizeStartText
public String getSizeStartText()
Gets the text to output when a
Collection
,
Map
or
Array
size is output.
This is output before the size value.
- getSizeStartText in interface ToStringStyle
- the current start of size text
getSummaryObjectEndText
public String getSummaryObjectEndText()
Gets the end text to output when an
Object
is
output in summary mode.
This is output after the size value.
- getSummaryObjectEndText in interface ToStringStyle
- the current end of summary text
getSummaryObjectStartText
public String getSummaryObjectStartText()
Gets the start text to output when an
Object
is
output in summary mode.
This is output before the size value.
- getSummaryObjectStartText in interface ToStringStyle
- the current start of summary text
isArrayContentDetail
public boolean isArrayContentDetail()
Gets whether to output array content detail.
- isArrayContentDetail in interface ToStringStyle
- the current array content detail setting
isDefaultFullDetail
public boolean isDefaultFullDetail()
Gets whether to use full detail when the caller doesn't
specify.
- isDefaultFullDetail in interface ToStringStyle
- the current defaultFullDetail flag
isFieldSeparatorAtEnd
public boolean isFieldSeparatorAtEnd()
Gets whether the field separator should be added at the end
of each buffer.
- isFieldSeparatorAtEnd in interface ToStringStyle
isFieldSeparatorAtStart
public boolean isFieldSeparatorAtStart()
Gets whether the field separator should be added at the start
of each buffer.
- isFieldSeparatorAtStart in interface ToStringStyle
- the fieldSeparatorAtStart flag
isUseClassName
public boolean isUseClassName()
Gets whether to use the class name.
- isUseClassName in interface ToStringStyle
- the current useClassName flag
isUseFieldNames
public boolean isUseFieldNames()
Gets whether to use the field names passed in.
- isUseFieldNames in interface ToStringStyle
- the current useFieldNames flag
isUseIdentityHashCode
public boolean isUseIdentityHashCode()
Gets whether to use the identity hash code.
- isUseIdentityHashCode in interface ToStringStyle
- the current useIdentityHashCode flag
isUseShortClassName
public boolean isUseShortClassName()
Gets whether to output short or long class names.
- isUseShortClassName in interface ToStringStyle
- the current useShortClassName flag
setArrayContentDetail
public void setArrayContentDetail(boolean arrayContentDetail)
Sets whether to output array content detail.
- setArrayContentDetail in interface ToStringStyle
arrayContentDetail
- the new arrayContentDetail flag
setArrayEnd
public void setArrayEnd(String arrayEnd)
Sets the array end text.
null
is accepted, but will be converted
to an empty String.
- setArrayEnd in interface ToStringStyle
arrayEnd
- the new array end text
setArraySeparator
public void setArraySeparator(String arraySeparator)
Sets the array separator text.
null
is accepted, but will be converted
to an empty String.
- setArraySeparator in interface ToStringStyle
arraySeparator
- the new array separator text
setArrayStart
public void setArrayStart(String arrayStart)
Sets the array start text.
null
is accepted, but will be converted
to an empty String.
- setArrayStart in interface ToStringStyle
arrayStart
- the new array start text
setContentEnd
public void setContentEnd(String contentEnd)
Sets the content end text.
null
is accepted, but will be converted
to an empty String.
- setContentEnd in interface ToStringStyle
contentEnd
- the new content end text
setContentStart
public void setContentStart(String contentStart)
Sets the content start text.
null
is accepted, but will be converted
to an empty String.
- setContentStart in interface ToStringStyle
contentStart
- the new content start text
setDefaultFullDetail
public void setDefaultFullDetail(boolean defaultFullDetail)
Sets whether to use full detail when the caller doesn't
specify.
- setDefaultFullDetail in interface ToStringStyle
defaultFullDetail
- the new defaultFullDetail flag
setFieldNameValueSeparator
public void setFieldNameValueSeparator(String fieldNameValueSeparator)
Sets the field name value separator text.
null
is accepted, but will be converted
to an empty String.
- setFieldNameValueSeparator in interface ToStringStyle
fieldNameValueSeparator
- the new field name value separator text
setFieldSeparator
public void setFieldSeparator(String fieldSeparator)
Sets the field separator text.
null
is accepted, but will be converted
to an empty String.
- setFieldSeparator in interface ToStringStyle
fieldSeparator
- the new field separator text
setFieldSeparatorAtEnd
public void setFieldSeparatorAtEnd(boolean fieldSeparatorAtEnd)
Sets whether the field separator should be added at the end
of each buffer.
- setFieldSeparatorAtEnd in interface ToStringStyle
fieldSeparatorAtEnd
- the fieldSeparatorAtEnd flag
setFieldSeparatorAtStart
public void setFieldSeparatorAtStart(boolean fieldSeparatorAtStart)
Sets whether the field separator should be added at the start
of each buffer.
- setFieldSeparatorAtStart in interface ToStringStyle
fieldSeparatorAtStart
- the fieldSeparatorAtStart flag
setNullText
public void setNullText(String nullText)
Sets the text to output when
null
found.
null
is accepted, but will be converted
to an empty String.
- setNullText in interface ToStringStyle
nullText
- the new text to output when null
found
setSizeEndText
public void setSizeEndText(String sizeEndText)
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.
- setSizeEndText in interface ToStringStyle
sizeEndText
- the new end of size text
setSizeStartText
public void setSizeStartText(String sizeStartText)
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.
- setSizeStartText in interface ToStringStyle
sizeStartText
- the new start of size text
setSummaryObjectEndText
public void setSummaryObjectEndText(String summaryObjectEndText)
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.
- setSummaryObjectEndText in interface ToStringStyle
summaryObjectEndText
- the new end of summary text
setSummaryObjectStartText
public void setSummaryObjectStartText(String summaryObjectStartText)
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.
- setSummaryObjectStartText in interface ToStringStyle
summaryObjectStartText
- the new start of summary text
setUseClassName
public void setUseClassName(boolean useClassName)
Sets whether to use the class name.
- setUseClassName in interface ToStringStyle
useClassName
- the new useClassName flag
setUseFieldNames
public void setUseFieldNames(boolean useFieldNames)
Sets whether to use the field names passed in.
- setUseFieldNames in interface ToStringStyle
useFieldNames
- the new useFieldNames flag
setUseIdentityHashCode
public void setUseIdentityHashCode(boolean useIdentityHashCode)
Sets whether to use the identity hash code.
- setUseIdentityHashCode in interface ToStringStyle
useIdentityHashCode
- the new useIdentityHashCode flag
setUseShortClassName
public void setUseShortClassName(boolean useShortClassName)
Sets whether to output short or long class names.
- setUseShortClassName in interface ToStringStyle
useShortClassName
- the new useShortClassName flag