Annotation Interface NonnullElements
@Documented
@Target({FIELD,LOCAL_VARIABLE,METHOD,PARAMETER,PACKAGE})
public @interface NonnullElements
Indicates that the annotated collection cannot contain any null elements:
- Input collections as parameters MUST NOT contain any null elements.
- Collections returned by methods WILL NOT contain any null elements, and if mutable, callers MUST NOT add a null element.
When applied to a package, signifies that all collections used as parameters or return values within the package are implicitly carrying this annotation.
Behavior is undefined if these constraints are violated. Some form of exception should be expected.