diff options
Diffstat (limited to 'website/features/Constructor.html')
-rw-r--r-- | website/features/Constructor.html | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/website/features/Constructor.html b/website/features/Constructor.html index cbb76fcf..d7168372 100644 --- a/website/features/Constructor.html +++ b/website/features/Constructor.html @@ -17,8 +17,7 @@ <p> This set of 3 annotations generate a constructor that will accept 1 parameter for certain fields, and simply assigns this parameter to the field. </p><p> - <code>@NoArgsConstructor</code> will generate a constructor with no parameters. If this is not possible (because of final fields), a compiler error will result instead. - For fields with constraints, such as <code>@NonNull</code> fields, <em>no</em> check or assignment is generated, so be aware that these constraints may then not be + <code>@NoArgsConstructor</code> will generate a constructor with no parameters. If this is not possible (because of final fields), a compiler error will result instead, unless <code>@NoArgsConstructor(force = true)</code> is used, then all final fields are initialized with 0 / false / null. For fields with constraints, such as <code>@NonNull</code> fields, <em>no</em> check or assignment is generated, so be aware that these constraints may then not be fulfilled until those fields are properly initialized later. Certain java constructs, such as hibernate and the Service Provider Interface require a no-args constructor. This annotation is useful primarily in combination with either <code>@Data</code> or one of the other constructor generating annotations. </p><p> |