com.google.common.base
Class Objects.ToStringHelper

java.lang.Object
  extended by com.google.common.base.Objects.ToStringHelper
Enclosing class:
Objects

public static class Objects.ToStringHelper
extends Object

Support class for Objects.toStringHelper(java.lang.Object).

Since:
2
Author:
Jason Lee

Method Summary
 Objects.ToStringHelper add(String name, Object value)
          Adds a name/value pair to the formatted output in name=value format.
 Objects.ToStringHelper addValue(Object value)
          Adds a value to the formatted output in value format.

It is strongly encouraged to use add(String, Object) instead and give value a readable name.

 String toString()
          Returns the formatted string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

add

public Objects.ToStringHelper add(String name,
                                  @Nullable
                                  Object value)
Adds a name/value pair to the formatted output in name=value format. If value is null, the string "null" is used.


addValue

public Objects.ToStringHelper addValue(@Nullable
                                       Object value)
Adds a value to the formatted output in value format.

It is strongly encouraged to use add(String, Object) instead and give value a readable name.


toString

public String toString()
Returns the formatted string.

Overrides:
toString in class Object
Returns:
a string representation of the object.