Interface AnnotationFilter

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface AnnotationFilter
    Callback interface that can be used to filter specific annotation types.

    Note that the MergedAnnotations model (which this interface has been designed for) always ignores lang annotations according to the PLAIN filter (for efficiency reasons). Any additional filters and even custom filter implementations apply within this boundary and may only narrow further from here.

    Since:
    5.2
    Author:
    Phillip Webb, Juergen Hoeller
    See Also:
    MergedAnnotations
    • Method Detail

      • matches

        default boolean matches​(Annotation annotation)
        Test if the given annotation matches the filter.
        Parameters:
        annotation - the annotation to test
        Returns:
        true if the annotation matches
      • matches

        default boolean matches​(Class<?> type)
        Test if the given type matches the filter.
        Parameters:
        type - the annotation type to test
        Returns:
        true if the annotation matches
      • matches

        boolean matches​(String typeName)
        Test if the given type name matches the filter.
        Parameters:
        typeName - the fully qualified class name of the annotation type to test
        Returns:
        true if the annotation matches