public class

ToStringCreator

extends Object
java.lang.Object
   ↳ org.springframework.core.style.ToStringCreator

Class Overview

Utility class that builds pretty-printing toString() methods with pluggable styling conventions. By default, ToStringCreator adheres to Spring's toString() styling conventions.

Summary

Public Constructors
ToStringCreator(Object obj)
Create a ToStringCreator for the given object.
ToStringCreator(Object obj, ValueStyler styler)
Create a ToStringCreator for the given object, using the provided style.
ToStringCreator(Object obj, ToStringStyler styler)
Create a ToStringCreator for the given object, using the provided style.
Public Methods
ToStringCreator append(String fieldName, boolean value)
Append a boolean field value.
ToStringCreator append(String fieldName, int value)
Append a integer field value.
ToStringCreator append(String fieldName, short value)
Append a short field value.
ToStringCreator append(String fieldName, long value)
Append a long field value.
ToStringCreator append(Object value)
Append the provided value.
ToStringCreator append(String fieldName, float value)
Append a float field value.
ToStringCreator append(String fieldName, Object value)
Append a field value.
ToStringCreator append(String fieldName, double value)
Append a double field value.
ToStringCreator append(String fieldName, byte value)
Append a byte field value.
String toString()
Return the String representation that this ToStringCreator built.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ToStringCreator (Object obj)

Also: SpringCore

Create a ToStringCreator for the given object.

Parameters
obj the object to be stringified

public ToStringCreator (Object obj, ValueStyler styler)

Also: SpringCore

Create a ToStringCreator for the given object, using the provided style.

Parameters
obj the object to be stringified
styler the ValueStyler encapsulating pretty-print instructions

public ToStringCreator (Object obj, ToStringStyler styler)

Also: SpringCore

Create a ToStringCreator for the given object, using the provided style.

Parameters
obj the object to be stringified
styler the ToStringStyler encapsulating pretty-print instructions

Public Methods

public ToStringCreator append (String fieldName, boolean value)

Also: SpringCore

Append a boolean field value.

Parameters
fieldName the name of the field, usually the member variable name
value the field value
Returns
  • this, to support call-chaining

public ToStringCreator append (String fieldName, int value)

Also: SpringCore

Append a integer field value.

Parameters
fieldName the name of the field, usually the member variable name
value the field value
Returns
  • this, to support call-chaining

public ToStringCreator append (String fieldName, short value)

Also: SpringCore

Append a short field value.

Parameters
fieldName the name of the field, usually the member variable name
value the field value
Returns
  • this, to support call-chaining

public ToStringCreator append (String fieldName, long value)

Also: SpringCore

Append a long field value.

Parameters
fieldName the name of the field, usually the member variable name
value the field value
Returns
  • this, to support call-chaining

public ToStringCreator append (Object value)

Also: SpringCore

Append the provided value.

Parameters
value The value to append
Returns
  • this, to support call-chaining.

public ToStringCreator append (String fieldName, float value)

Also: SpringCore

Append a float field value.

Parameters
fieldName the name of the field, usually the member variable name
value the field value
Returns
  • this, to support call-chaining

public ToStringCreator append (String fieldName, Object value)

Also: SpringCore

Append a field value.

Parameters
fieldName the name of the field, usually the member variable name
value the field value
Returns
  • this, to support call-chaining

public ToStringCreator append (String fieldName, double value)

Also: SpringCore

Append a double field value.

Parameters
fieldName the name of the field, usually the member variable name
value the field value
Returns
  • this, to support call-chaining

public ToStringCreator append (String fieldName, byte value)

Also: SpringCore

Append a byte field value.

Parameters
fieldName the name of the field, usually the member variable name
value the field value
Returns
  • this, to support call-chaining

public String toString ()

Return the String representation that this ToStringCreator built.