@Target(value={FIELD,METHOD,PARAMETER,LOCAL_VARIABLE}) @Retention(value=CLASS) @Documented public @interface NonNull
NullPointerException
with the parameter's name as message. If put on a field, any generated method assigning
a value to this field will also produce these nullchecks.
Note that any annotation named NonNull
with any casing and any package will result in nullchecks produced for
generated methods (and the annotation will be copied to the getter return type and any parameters of generated methods),
but only this annotation, if present on a parameter, will result in a null check inserted into your otherwise
handwritten method.
WARNING: If the java community ever does decide on supporting a single @NonNull
annotation (for example via JSR305), then
this annotation will be deleted from the lombok package. If the need to update an import statement scares
you, you should use your own annotation named @NonNull
instead of this one.
Copyright © 2009-2011 The Project Lombok Authors, licensed under the MIT licence.