public static final class Objects.ToStringHelper extends Object
Objects.toStringHelper(java.lang.Object)
.Modifier and Type | Method and Description |
---|---|
Objects.ToStringHelper |
add(String name,
Object value)
Adds a name/value pair to the formatted output in
name=value format. |
Objects.ToStringHelper |
omitNullValues()
Configures the
Objects.ToStringHelper so toString() will ignore properties with null
value. |
String |
toString() |
public Objects.ToStringHelper omitNullValues()
Objects.ToStringHelper
so toString()
will ignore properties with null
value. The order of calling this method, relative to the add()
/addValue()
methods, is not significant.public Objects.ToStringHelper add(String name, Object value)
name=value
format. If value
is null
, the string "null"
is used, unless omitNullValues()
is
called, in which case this name/value pair will not be added.Copyright © 2011–2023 Google. All rights reserved.