Purpose of @NotNull.List
问题 When I looked among the standard constraints in Bean Validation API (JSR-303), I found the NotNull.List annotation. Its description is: Defines several @NotNull annotations on the same element This is valid syntax: @NotNull.List({@NotNull, @NotNull}) private Object myObject; But it makes no sense. Either the object is null or it is not. When would you use this annotation? There are several other similar annotations like AssertFalse.List and AssertTrue.List . 回答1: You can have multiple