org.apache.hivemind.util
Class ToStringBuilder
java.lang.Object
org.apache.hivemind.util.ToStringBuilder
public class ToStringBuilder
- extends java.lang.Object
A simple replacement for the more involved version in commons-lang; this is used
to help construct the description string returned by an object's
toString()
method.
- Author:
- Howard Lewis Ship
Method Summary |
void |
append(java.lang.String attributeName,
boolean value)
|
void |
append(java.lang.String attributeName,
byte value)
|
void |
append(java.lang.String attributeName,
int value)
|
void |
append(java.lang.String attributeName,
java.lang.Object value)
|
void |
append(java.lang.String attributeName,
short value)
|
void |
append(java.lang.String attributeName,
java.lang.String value)
|
static int |
getDefaultMode()
|
static void |
setDefaultMode(int i)
|
java.lang.String |
toString()
Returns the final assembled string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
INCLUDE_PACKAGE_PREFIX
public static final int INCLUDE_PACKAGE_PREFIX
- See Also:
- Constant Field Values
INCLUDE_HASHCODE
public static final int INCLUDE_HASHCODE
- See Also:
- Constant Field Values
ToStringBuilder
public ToStringBuilder(java.lang.Object target)
ToStringBuilder
public ToStringBuilder(java.lang.Object target,
int mode)
getDefaultMode
public static int getDefaultMode()
setDefaultMode
public static void setDefaultMode(int i)
toString
public java.lang.String toString()
- Returns the final assembled string. This may only be invoked once, after
all attributes have been appended.
- Overrides:
toString
in class java.lang.Object
append
public void append(java.lang.String attributeName,
boolean value)
append
public void append(java.lang.String attributeName,
byte value)
append
public void append(java.lang.String attributeName,
short value)
append
public void append(java.lang.String attributeName,
int value)
append
public void append(java.lang.String attributeName,
java.lang.Object value)
append
public void append(java.lang.String attributeName,
java.lang.String value)