A set of annotations used to document constraints on methods, fields, parameters, etc. Note, these annotations are for documentation purposes only. They do not have any effect on the executing code. Use a JSR-303 implementation if that's what you're after.
Annotation Types Summary Annotation Type Description LiveIndicates that the annotated object is "live" and that changes made to it will be reflected in its "owner" and vice versa. NegativeIndicates that the annotated item will be negative (i.e., less than zero). NonNegativeIndicates that the annotated item will be non-negative (i.e., greater than or equal to zero). NonnullAfterInitIndicates that the annotated item will not be null after initialization of its containing component. NonnullElementsIndicates 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. NonPositiveIndicates that the annotated item will be non-positive (i.e., less than or equal to zero). NotEmptyIndicates that the annotated array, string, collection, or other object is not empty. NotLiveIndicates that the annotated object is not "live" and that changes made to it will not be reflected in its "owner" and vice versa. NullableElementsIndicates that the annotated collection may contain null elements and, if mutable, null elements may be added to it safely. PositiveIndicates that the annotated item will be positive (i.e., greater than zero). ThreadSafeAfterInitIndicates that the annotated class will meet the definition of the
ThreadSafeannotation after its initialization and before its destruction.
UnmodifiableIndicates that the annotated object cannot be modified.