Class StandardToStringStyle
- All Implemented Interfaces:
Serializable
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
- See Also:
-
Field Summary
Fields inherited from class edu.internet2.middleware.grouperClientExt.org.apache.commons.lang3.builder.ToStringStyle
DEFAULT_STYLE, JSON_STYLE, MULTI_LINE_STYLE, NO_CLASS_NAME_STYLE, NO_FIELD_NAMES_STYLE, SHORT_PREFIX_STYLE, SIMPLE_STYLE
-
Constructor Summary
-
Method Summary
Modifier 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 whennull
found.Gets the end text to output when aCollection
,Map
orArray
size is output.Gets the text to output when aCollection
,Map
orArray
size is output.Gets the end text to output when anObject
is output in summary mode.Gets the start text to output when anObject
is output in summary mode.boolean
Gets whether to output array content detail.boolean
Gets whether to use full detail when the caller doesn't specify.boolean
Gets whether the field separator should be added at the end of each buffer.boolean
Gets whether the field separator should be added at the start of each buffer.boolean
Gets whether to use the class name.boolean
Gets whether to use the field names passed in.boolean
Gets whether to use the identity hash code.boolean
Gets whether to output short or long class names.void
setArrayContentDetail
(boolean arrayContentDetail) Sets whether to output array content detail.void
setArrayEnd
(String arrayEnd) Sets the array end text.void
setArraySeparator
(String arraySeparator) Sets the array separator text.void
setArrayStart
(String arrayStart) Sets the array start text.void
setContentEnd
(String contentEnd) Sets the content end text.void
setContentStart
(String contentStart) Sets the content start text.void
setDefaultFullDetail
(boolean defaultFullDetail) Sets whether to use full detail when the caller doesn't specify.void
setFieldNameValueSeparator
(String fieldNameValueSeparator) Sets the field name value separator text.void
setFieldSeparator
(String fieldSeparator) Sets the field separator text.void
setFieldSeparatorAtEnd
(boolean fieldSeparatorAtEnd) Sets whether the field separator should be added at the end of each buffer.void
setFieldSeparatorAtStart
(boolean fieldSeparatorAtStart) Sets whether the field separator should be added at the start of each buffer.void
setNullText
(String nullText) Sets the text to output whennull
found.void
setSizeEndText
(String sizeEndText) Sets the end text to output when aCollection
,Map
orArray
size is output.void
setSizeStartText
(String sizeStartText) Sets the start text to output when aCollection
,Map
orArray
size is output.void
setSummaryObjectEndText
(String summaryObjectEndText) Sets the end text to output when anObject
is output in summary mode.void
setSummaryObjectStartText
(String summaryObjectStartText) Sets the start text to output when anObject
is output in summary mode.void
setUseClassName
(boolean useClassName) Sets whether to use the class name.void
setUseFieldNames
(boolean useFieldNames) Sets whether to use the field names passed in.void
setUseIdentityHashCode
(boolean useIdentityHashCode) Sets whether to use the identity hash code.void
setUseShortClassName
(boolean useShortClassName) Sets whether to output short or long class names.Methods inherited from class edu.internet2.middleware.grouperClientExt.org.apache.commons.lang3.builder.ToStringStyle
append, 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, getShortClassName, isFullDetail, reflectionAppendArrayDetail, removeLastFieldSeparator
-
Constructor Details
-
StandardToStringStyle
public StandardToStringStyle()Constructor.
-
-
Method Details
-
isUseClassName
public boolean isUseClassName()Gets whether to use the class name.
- Overrides:
isUseClassName
in classToStringStyle
- Returns:
- the current useClassName flag
-
setUseClassName
public void setUseClassName(boolean useClassName) Sets whether to use the class name.
- Overrides:
setUseClassName
in classToStringStyle
- Parameters:
useClassName
- the new useClassName flag
-
isUseShortClassName
public boolean isUseShortClassName()Gets whether to output short or long class names.
- Overrides:
isUseShortClassName
in classToStringStyle
- Returns:
- the current useShortClassName flag
- Since:
- 2.0
-
setUseShortClassName
public void setUseShortClassName(boolean useShortClassName) Sets whether to output short or long class names.
- Overrides:
setUseShortClassName
in classToStringStyle
- Parameters:
useShortClassName
- the new useShortClassName flag- Since:
- 2.0
-
isUseIdentityHashCode
public boolean isUseIdentityHashCode()Gets whether to use the identity hash code.
- Overrides:
isUseIdentityHashCode
in classToStringStyle
- Returns:
- the current useIdentityHashCode flag
-
setUseIdentityHashCode
public void setUseIdentityHashCode(boolean useIdentityHashCode) Sets whether to use the identity hash code.
- Overrides:
setUseIdentityHashCode
in classToStringStyle
- Parameters:
useIdentityHashCode
- the new useIdentityHashCode flag
-
isUseFieldNames
public boolean isUseFieldNames()Gets whether to use the field names passed in.
- Overrides:
isUseFieldNames
in classToStringStyle
- Returns:
- the current useFieldNames flag
-
setUseFieldNames
public void setUseFieldNames(boolean useFieldNames) Sets whether to use the field names passed in.
- Overrides:
setUseFieldNames
in classToStringStyle
- Parameters:
useFieldNames
- the new useFieldNames flag
-
isDefaultFullDetail
public boolean isDefaultFullDetail()Gets whether to use full detail when the caller doesn't specify.
- Overrides:
isDefaultFullDetail
in classToStringStyle
- Returns:
- the current defaultFullDetail flag
-
setDefaultFullDetail
public void setDefaultFullDetail(boolean defaultFullDetail) Sets whether to use full detail when the caller doesn't specify.
- Overrides:
setDefaultFullDetail
in classToStringStyle
- Parameters:
defaultFullDetail
- the new defaultFullDetail flag
-
isArrayContentDetail
public boolean isArrayContentDetail()Gets whether to output array content detail.
- Overrides:
isArrayContentDetail
in classToStringStyle
- Returns:
- the current array content detail setting
-
setArrayContentDetail
public void setArrayContentDetail(boolean arrayContentDetail) Sets whether to output array content detail.
- Overrides:
setArrayContentDetail
in classToStringStyle
- Parameters:
arrayContentDetail
- the new arrayContentDetail flag
-
getArrayStart
Gets the array start text.
- Overrides:
getArrayStart
in classToStringStyle
- Returns:
- the current array start text
-
setArrayStart
Sets the array start text.
null
is accepted, but will be converted to an empty String.- Overrides:
setArrayStart
in classToStringStyle
- Parameters:
arrayStart
- the new array start text
-
getArrayEnd
Gets the array end text.
- Overrides:
getArrayEnd
in classToStringStyle
- Returns:
- the current array end text
-
setArrayEnd
Sets the array end text.
null
is accepted, but will be converted to an empty String.- Overrides:
setArrayEnd
in classToStringStyle
- Parameters:
arrayEnd
- the new array end text
-
getArraySeparator
Gets the array separator text.
- Overrides:
getArraySeparator
in classToStringStyle
- Returns:
- the current array separator text
-
setArraySeparator
Sets the array separator text.
null
is accepted, but will be converted to an empty String.- Overrides:
setArraySeparator
in classToStringStyle
- Parameters:
arraySeparator
- the new array separator text
-
getContentStart
Gets the content start text.
- Overrides:
getContentStart
in classToStringStyle
- Returns:
- the current content start text
-
setContentStart
Sets the content start text.
null
is accepted, but will be converted to an empty String.- Overrides:
setContentStart
in classToStringStyle
- Parameters:
contentStart
- the new content start text
-
getContentEnd
Gets the content end text.
- Overrides:
getContentEnd
in classToStringStyle
- Returns:
- the current content end text
-
setContentEnd
Sets the content end text.
null
is accepted, but will be converted to an empty String.- Overrides:
setContentEnd
in classToStringStyle
- Parameters:
contentEnd
- the new content end text
-
getFieldNameValueSeparator
Gets the field name value separator text.
- Overrides:
getFieldNameValueSeparator
in classToStringStyle
- Returns:
- the current field name value separator text
-
setFieldNameValueSeparator
Sets the field name value separator text.
null
is accepted, but will be converted to an empty String.- Overrides:
setFieldNameValueSeparator
in classToStringStyle
- Parameters:
fieldNameValueSeparator
- the new field name value separator text
-
getFieldSeparator
Gets the field separator text.
- Overrides:
getFieldSeparator
in classToStringStyle
- Returns:
- the current field separator text
-
setFieldSeparator
Sets the field separator text.
null
is accepted, but will be converted to an empty String.- Overrides:
setFieldSeparator
in classToStringStyle
- Parameters:
fieldSeparator
- the new field separator text
-
isFieldSeparatorAtStart
public boolean isFieldSeparatorAtStart()Gets whether the field separator should be added at the start of each buffer.
- Overrides:
isFieldSeparatorAtStart
in classToStringStyle
- Returns:
- the fieldSeparatorAtStart flag
- Since:
- 2.0
-
setFieldSeparatorAtStart
public void setFieldSeparatorAtStart(boolean fieldSeparatorAtStart) Sets whether the field separator should be added at the start of each buffer.
- Overrides:
setFieldSeparatorAtStart
in classToStringStyle
- Parameters:
fieldSeparatorAtStart
- the fieldSeparatorAtStart flag- Since:
- 2.0
-
isFieldSeparatorAtEnd
public boolean isFieldSeparatorAtEnd()Gets whether the field separator should be added at the end of each buffer.
- Overrides:
isFieldSeparatorAtEnd
in classToStringStyle
- Returns:
- fieldSeparatorAtEnd flag
- Since:
- 2.0
-
setFieldSeparatorAtEnd
public void setFieldSeparatorAtEnd(boolean fieldSeparatorAtEnd) Sets whether the field separator should be added at the end of each buffer.
- Overrides:
setFieldSeparatorAtEnd
in classToStringStyle
- Parameters:
fieldSeparatorAtEnd
- the fieldSeparatorAtEnd flag- Since:
- 2.0
-
getNullText
Gets the text to output when
null
found.- Overrides:
getNullText
in classToStringStyle
- Returns:
- the current text to output when
null
found
-
setNullText
Sets the text to output when
null
found.null
is accepted, but will be converted to an empty String.- Overrides:
setNullText
in classToStringStyle
- Parameters:
nullText
- the new text to output whennull
found
-
getSizeStartText
Gets the text to output when a
Collection
,Map
orArray
size is output.This is output before the size value.
- Overrides:
getSizeStartText
in classToStringStyle
- Returns:
- the current start of size text
-
setSizeStartText
Sets the start text to output when a
Collection
,Map
orArray
size is output.This is output before the size value.
null
is accepted, but will be converted to an empty String.- Overrides:
setSizeStartText
in classToStringStyle
- Parameters:
sizeStartText
- the new start of size text
-
getSizeEndText
Gets the end text to output when a
Collection
,Map
orArray
size is output.This is output after the size value.
- Overrides:
getSizeEndText
in classToStringStyle
- Returns:
- the current end of size text
-
setSizeEndText
Sets the end text to output when a
Collection
,Map
orArray
size is output.This is output after the size value.
null
is accepted, but will be converted to an empty String.- Overrides:
setSizeEndText
in classToStringStyle
- Parameters:
sizeEndText
- the new end of size text
-
getSummaryObjectStartText
Gets the start text to output when an
Object
is output in summary mode.This is output before the size value.
- Overrides:
getSummaryObjectStartText
in classToStringStyle
- Returns:
- the current start of summary text
-
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.- Overrides:
setSummaryObjectStartText
in classToStringStyle
- Parameters:
summaryObjectStartText
- the new start of summary text
-
getSummaryObjectEndText
Gets the end text to output when an
Object
is output in summary mode.This is output after the size value.
- Overrides:
getSummaryObjectEndText
in classToStringStyle
- Returns:
- the current end of summary text
-
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.- Overrides:
setSummaryObjectEndText
in classToStringStyle
- Parameters:
summaryObjectEndText
- the new end of summary text
-