@Target(value=TYPE) @Retention(value=SOURCE) public @interface ToString
toString
method inherited by all objects, consisting of printing the values of relevant fields.
Complete documentation is found at the project lombok features page for @ToString.
Modifier and Type | Optional Element and Description |
---|---|
boolean |
callSuper
Include the result of the superclass's implementation of
toString in the output. |
boolean |
doNotUseGetters
Normally, if getters are available, those are called.
|
String[] |
exclude
Any fields listed here will not be printed in the generated
toString implementation. |
boolean |
includeFieldNames
Include the name of each field when printing it.
|
String[] |
of
If present, explicitly lists the fields that are to be printed.
|
boolean |
onlyExplicitlyIncluded
Only include fields and methods explicitly marked with
@ToString.Include . |
public abstract boolean includeFieldNames
toString()
.public abstract String[] of
Mutually exclusive with exclude()
.
Will soon be marked @Deprecated
; use the @ToString.Include
annotation together with @ToString(onlyExplicitlyIncluded = true)
.
public abstract boolean callSuper
toString
in the output.
default: falsetoString
implementation as part of the generated toString algorithm.public abstract boolean doNotUseGetters
true
.
default: falsetrue
, always use direct field access instead of calling the getter method.Copyright © 2024. All rights reserved.