Annotation Type NonNull
-
@Retention(RUNTIME) @Target({FIELD,METHOD,PARAMETER,TYPE_PARAMETER}) public @interface NonNullIndicates that the annotated field or parameter must not be set tonull. If validation is active, an exception is thrown when a message is received where aNonNullfield has anullorundefinedvalue. 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.