MoreObjects.ToStringHelper instead. This class is scheduled for removal in June 2016.
@Deprecated public static final class Objects.ToStringHelper extends Object
Objects.toStringHelper(java.lang.Object) .
| Modifier and Type | Method and Description |
|---|---|
Objects |
add(String
Deprecated.
Adds a name/value pair to the formatted output in
name=value format.
|
Objects |
add(String
Deprecated.
Adds a name/value pair to the formatted output in
name=value format.
|
Objects |
add(String
Deprecated.
Adds a name/value pair to the formatted output in
name=value format.
|
Objects |
add(String
Deprecated.
Adds a name/value pair to the formatted output in
name=value format.
|
Objects |
add(String
Deprecated.
Adds a name/value pair to the formatted output in
name=value format.
|
Objects |
add(String
Deprecated.
Adds a name/value pair to the formatted output in
name=value format.
|
Objects |
add(String
Deprecated.
Adds a name/value pair to the formatted output in
name=value format.
|
Objects |
addValue(boolean value)
Deprecated.
Adds an unnamed value to the formatted output.
|
Objects |
addValue(char value)
Deprecated.
Adds an unnamed value to the formatted output.
|
Objects |
addValue(double value)
Deprecated.
Adds an unnamed value to the formatted output.
|
Objects |
addValue(float value)
Deprecated.
Adds an unnamed value to the formatted output.
|
Objects |
addValue(int value)
Deprecated.
Adds an unnamed value to the formatted output.
|
Objects |
addValue(long value)
Deprecated.
Adds an unnamed value to the formatted output.
|
Objects |
addValue(Object
Deprecated.
Adds an unnamed value to the formatted output.
|
Objects |
omitNullValues()
Deprecated.
Configures the
Objects.ToStringHelper so
toString() will ignore properties with null value.
|
String |
toString()
Deprecated.
Returns a string in the format specified by
Objects.
|
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.
public Objects.ToStringHelper add(String name, boolean value)
name=value format.
public Objects.ToStringHelper add(String name, char value)
name=value format.
public Objects.ToStringHelper add(String name, double value)
name=value format.
public Objects.ToStringHelper add(String name, float value)
name=value format.
public Objects.ToStringHelper add(String name, int value)
name=value format.
public Objects.ToStringHelper add(String name, long value)
name=value format.
public Objects.ToStringHelper addValue(Object value)
It is strongly encouraged to use add(String, Object) instead and give value a readable name.
public Objects.ToStringHelper addValue(boolean value)
It is strongly encouraged to use add(String, boolean) instead and give value a readable name.
public Objects.ToStringHelper addValue(char value)
It is strongly encouraged to use add(String, char) instead and give value a readable name.
public Objects.ToStringHelper addValue(double value)
It is strongly encouraged to use add(String, double) instead and give value a readable name.
public Objects.ToStringHelper addValue(float value)
It is strongly encouraged to use add(String, float) instead and give value a readable name.
public Objects.ToStringHelper addValue(int value)
It is strongly encouraged to use add(String, int) instead and give value a readable name.
public Objects.ToStringHelper addValue(long value)
It is strongly encouraged to use add(String, long) instead and give value a readable name.
public StringtoString()
Objects.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).