@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD,PARAMETER,TYPE_PARAMETER})
public @interface NonNull
Indicates that the annotated field or parameter must not be set to null
. If validation
is active, an exception is thrown when a message is received where a NonNull
field
has a null
or undefined
value.
In order to achieve consistent behavior, for every field with this annotation the corresponding
getter method as well as the parameter of the corresponding setter method are also expected to
be annotated.