Class MoreObjects.ToStringHelper
- java.lang.Object
-
- org.glassfish.jersey.internal.guava.MoreObjects.ToStringHelper
-
- Enclosing class:
- MoreObjects
public static final class MoreObjects.ToStringHelper extends Object
Support class forMoreObjects.toStringHelper(java.lang.Object).- Since:
- 18.0 (since 2.0 as
Objects.ToStringHelper. - Author:
- Jason Lee
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MoreObjects.ToStringHelperadd(String name, int value)Adds a name/value pair to the formatted output inname=valueformat.MoreObjects.ToStringHelperadd(String name, long value)Adds a name/value pair to the formatted output inname=valueformat.MoreObjects.ToStringHelperadd(String name, Object value)Adds a name/value pair to the formatted output inname=valueformat.StringtoString()Returns a string in the format specified byMoreObjects.toStringHelper(Object).
-
-
-
Method Detail
-
add
public MoreObjects.ToStringHelper add(String name, Object value)
Adds a name/value pair to the formatted output inname=valueformat. Ifvalueisnull, the string"null"is used, unless#omitNullValues()is called, in which case this name/value pair will not be added.
-
add
public MoreObjects.ToStringHelper add(String name, int value)
Adds a name/value pair to the formatted output inname=valueformat.- Since:
- 18.0 (since 11.0 as
Objects.ToStringHelper.omitNullValues().
-
add
public MoreObjects.ToStringHelper add(String name, long value)
Adds a name/value pair to the formatted output inname=valueformat.- Since:
- 18.0 (since 11.0 as
Objects.ToStringHelper.omitNullValues().
-
toString
public String toString()
Returns a string in the format specified byMoreObjects.toStringHelper(Object).After calling this method, you can keep adding more properties to later call toString() again and get a more complete representation of the same object; but properties cannot be removed, so this only allows limited reuse of the helper instance. The helper allows duplication of properties (multiple name/value pairs with the same name can be added).
-
-