@Documented
@Retention(value=CLASS)
@Target(value={METHOD,FIELD,PARAMETER,LOCAL_VARIABLE,TYPE_USE})
public @interface NotNull
null
value is forbidden
to return (for methods), pass to (parameters) and hold (local variables and fields).
Apart from documentation purposes this annotation is intended to be used by static analysis tools
to validate against probable runtime errors and element contract violations.public abstract java.lang.String value
public abstract java.lang.Class<? extends java.lang.Exception> exception
IllegalArgumentException
is thrown on null method arguments and
IllegalStateException
— on null return value.