|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.core.style.ToStringCreator
public class ToStringCreator
Utility class that builds pretty-printing toString()
methods
with pluggable styling conventions. By default, ToStringCreator adheres
to Spring's toString()
styling conventions.
Constructor Summary | |
---|---|
ToStringCreator(Object obj)
Create a ToStringCreator for the given object. |
|
ToStringCreator(Object obj,
ToStringStyler styler)
Create a ToStringCreator for the given object, using the provided style. |
|
ToStringCreator(Object obj,
ValueStyler styler)
Create a ToStringCreator for the given object, using the provided style. |
Method Summary | |
---|---|
ToStringCreator |
append(Object value)
Append the provided value. |
ToStringCreator |
append(String fieldName,
boolean value)
Append a boolean field value. |
ToStringCreator |
append(String fieldName,
byte value)
Append a byte field value. |
ToStringCreator |
append(String fieldName,
double value)
Append a double field value. |
ToStringCreator |
append(String fieldName,
float value)
Append a float field value. |
ToStringCreator |
append(String fieldName,
int value)
Append a integer field value. |
ToStringCreator |
append(String fieldName,
long value)
Append a long field value. |
ToStringCreator |
append(String fieldName,
Object value)
Append a field value. |
ToStringCreator |
append(String fieldName,
short value)
Append a short field value. |
String |
toString()
Return the String representation that this ToStringCreator built. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ToStringCreator(Object obj)
obj
- the object to be stringifiedpublic ToStringCreator(Object obj, ValueStyler styler)
obj
- the object to be stringifiedstyler
- the ValueStyler encapsulating pretty-print instructionspublic ToStringCreator(Object obj, ToStringStyler styler)
obj
- the object to be stringifiedstyler
- the ToStringStyler encapsulating pretty-print instructionsMethod Detail |
---|
public ToStringCreator append(String fieldName, byte value)
fieldName
- the name of the field, usually the member variable namevalue
- the field value
public ToStringCreator append(String fieldName, short value)
fieldName
- the name of the field, usually the member variable namevalue
- the field value
public ToStringCreator append(String fieldName, int value)
fieldName
- the name of the field, usually the member variable namevalue
- the field value
public ToStringCreator append(String fieldName, float value)
fieldName
- the name of the field, usually the member variable namevalue
- the field value
public ToStringCreator append(String fieldName, double value)
fieldName
- the name of the field, usually the member variable namevalue
- the field value
public ToStringCreator append(String fieldName, long value)
fieldName
- the name of the field, usually the member variable namevalue
- the field value
public ToStringCreator append(String fieldName, boolean value)
fieldName
- the name of the field, usually the member variable namevalue
- the field value
public ToStringCreator append(String fieldName, Object value)
fieldName
- the name of the field, usually the member variable namevalue
- the field value
public ToStringCreator append(Object value)
value
- The value to append
public String toString()
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |