Annotation Type ToString
-
@Beta @Target(TYPE) @GwtCompatible public @interface ToString
Creates a defaulttoString
implementation.All non-static fields of this class and all of its superclasses are used. Reflection is used to access all fields if this class has a superclass. This may not work in restrictive environments. For such cases use
The default format is:ToStringBuilder
to write a non-reflective implementation.ClassName [ field1 = "Foo" field2 = 2 field3 = null ]
The class name is hardcoded. Subclasses which inherit this class without overridingtoString
will show the same name.For brevity there are options to hide field names, skip fields with null values and print everything on one line.
- Since:
- 2.7
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
hideFieldNames
Only list the values of the fields, not their namesboolean
singleLine
Seperate fields with a comma and a single spaceboolean
skipNulls
Fields with null values are not shown in the output.boolean
verbatimValues
By default, Iterables, Arrays and multiline Strings are pretty-printed.
-