public static class ToStringBuilder
extends java.lang.Object
Object#toString()
representations.
You can customize the output using the builder-style methods ToStringBuilder.singleLine()
ToStringBuilder.skipNulls()
and ToStringBuilder.hideFieldNames()
.
You can either directly list fields to include via ToStringBuilder.add(String, Object)
and ToStringBuilder.add(Object)
or you can let the builder do it automatically using reflection, either including the fields declared in this class or including all superclasses.
The builder will automatically handle cycles in the object tree. It also pretty prints arrays and Iterables.
This class is not thread safe.