Package com.vaadin.flow.internal
Class ToStringBuilder
java.lang.Object
com.vaadin.flow.internal.ToStringBuilder
Builds a
toString() value in the SimpleName[?] shape, such as
ThemeData[themeName=lumo, variant=dark] or
NodeInstallation[/home/user/.vaadin/node-v24.10.0].
The name is the simple name of the runtime class of the described instance,
so that a subclass reports its own type. An anonymous class has no simple
name, so the closest named superclass is used instead, or the interface it
implements when it extends Object directly.
For internal use only. May be renamed or removed in a future release.
- Since:
- 25.4
-
Method Summary
Modifier and TypeMethodDescriptionAdds a value as aname=valuepair.addIfNotNull(String name, Object value) Adds a value as aname=valuepair if it is notnull.Adds a value without a name, for a value that is clear without one.static ToStringBuilderStarts building thetoString()value of the given instance.toString()
-
Method Details
-
of
Starts building thetoString()value of the given instance.- Parameters:
instance- the instance to describe, notnull- Returns:
- a new builder, not
null
-
add
Adds a value as aname=valuepair.- Parameters:
name- the name of the value, notnullvalue- the value, may benull- Returns:
- this builder, for chaining
-
addIfNotNull
Adds a value as aname=valuepair if it is notnull.- Parameters:
name- the name of the value, notnullvalue- the value, may benull- Returns:
- this builder, for chaining
-
addValue
Adds a value without a name, for a value that is clear without one.- Parameters:
value- the value, may benull- Returns:
- this builder, for chaining
-
toString
-