com.google.common.base
Class Objects.ToStringHelper

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

public static final class Objects.ToStringHelper
extends Object

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

Since:
2.0
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.
 String toString()
          Returns a string in the format specified by Objects.toStringHelper(Object).
 
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 a string in the format specified by Objects.toStringHelper(Object).

Overrides:
toString in class Object


Copyright © 2010-2011. All Rights Reserved.