org.apache.hivemind.util
Class ToStringBuilder

java.lang.Object
  extended by 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

Field Summary
static int INCLUDE_HASHCODE
           
static int INCLUDE_PACKAGE_PREFIX
           
 
Constructor Summary
ToStringBuilder(java.lang.Object target)
           
ToStringBuilder(java.lang.Object target, int mode)
           
 
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
 

Field Detail

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
Constructor Detail

ToStringBuilder

public ToStringBuilder(java.lang.Object target)

ToStringBuilder

public ToStringBuilder(java.lang.Object target,
                       int mode)
Method Detail

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)