Class RepeatableContainers
java.lang.Object
org.springframework.core.annotation.RepeatableContainers
Strategy used to determine annotations that act as containers for other
 annotations. The 
standardRepeatables() method provides a default
 strategy that respects Java's @Repeatable support and
 should be suitable for most situations.
 The of(java.lang.Class<? extends java.lang.annotation.Annotation>, java.lang.Class<? extends java.lang.annotation.Annotation>) method can be used to register relationships for
 annotations that do not wish to use @Repeatable.
 
To completely disable repeatable support use none().
- Since:
 - 5.2
 - Author:
 - Phillip Webb, Sam Brannen
 
- 
Method Summary
Modifier and TypeMethodDescriptionand(Class<? extends Annotation> container, Class<? extends Annotation> repeatable) Add an additional explicit relationship between a container and repeatable annotation.booleaninthashCode()static RepeatableContainersnone()Create aRepeatableContainersinstance that does not support any repeatable annotations.static RepeatableContainersof(Class<? extends Annotation> repeatable, Class<? extends Annotation> container) Create aRepeatableContainersinstance that uses predefined repeatable and container types.static RepeatableContainersCreate aRepeatableContainersinstance that searches using Java's@Repeatableannotation. 
- 
Method Details
- 
and
public RepeatableContainers and(Class<? extends Annotation> container, Class<? extends Annotation> repeatable) Add an additional explicit relationship between a container and repeatable annotation.WARNING: the arguments supplied to this method are in the reverse order of those supplied to
of(Class, Class).- Parameters:
 container- the container annotation typerepeatable- the repeatable annotation type- Returns:
 - a new 
RepeatableContainersinstance 
 - 
equals
 - 
hashCode
public int hashCode() - 
standardRepeatables
Create aRepeatableContainersinstance that searches using Java's@Repeatableannotation.- Returns:
 - a 
RepeatableContainersinstance 
 - 
of
public static RepeatableContainers of(Class<? extends Annotation> repeatable, @Nullable Class<? extends Annotation> container) Create aRepeatableContainersinstance that uses predefined repeatable and container types.WARNING: the arguments supplied to this method are in the reverse order of those supplied to
and(Class, Class).- Parameters:
 repeatable- the repeatable annotation typecontainer- the container annotation type ornull. If specified, this annotation must declare avalueattribute returning an array of repeatable annotations. If not specified, the container will be deduced by inspecting the@Repeatableannotation onrepeatable.- Returns:
 - a 
RepeatableContainersinstance - Throws:
 IllegalArgumentException- if the supplied container type isnulland the annotation type is not a repeatable annotationAnnotationConfigurationException- if the supplied container type is not a properly configured container for a repeatable annotation
 - 
none
Create aRepeatableContainersinstance that does not support any repeatable annotations.- Returns:
 - a 
RepeatableContainersinstance 
 
 -