Class Objects.ToStringHelper (1.45.0)

public static final class Objects.ToStringHelper

Support class for Objects#toStringHelper.

Inheritance

Object > Objects.ToStringHelper

Methods

add(String name, Object value)

public Objects.ToStringHelper add(String name, Object value)

Adds a name/value pair to the formatted output in 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.

Parameters
Name Description
name String
value Object
Returns
Type Description
Objects.ToStringHelper

omitNullValues()

public Objects.ToStringHelper omitNullValues()

Configures the ToStringHelper so #toString() will ignore properties with null value. The order of calling this method, relative to the add()/addValue() methods, is not significant.

Returns
Type Description
Objects.ToStringHelper

toString()

public String toString()
Returns
Type Description
String
Overrides