Interface MethodDescriptor


  • @API(status=STABLE,
         since="5.7")
    public interface MethodDescriptor
    MethodDescriptor encapsulates functionality for a given Method.
    Since:
    5.4
    See Also:
    MethodOrdererContext
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <A extends java.lang.annotation.Annotation>
      java.util.Optional<A>
      findAnnotation​(java.lang.Class<A> annotationType)
      Find the first annotation of annotationType that is either present or meta-present on the Method for this descriptor.
      <A extends java.lang.annotation.Annotation>
      java.util.List<A>
      findRepeatableAnnotations​(java.lang.Class<A> annotationType)
      Find all repeatable annotations of annotationType that are either present or meta-present on the Method for this descriptor.
      java.lang.String getDisplayName()
      Get the display name for this descriptor's method.
      java.lang.reflect.Method getMethod()
      Get the method for this descriptor.
      boolean isAnnotated​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
      Determine if an annotation of annotationType is either present or meta-present on the Method for this descriptor.
    • Method Detail

      • getMethod

        java.lang.reflect.Method getMethod()
        Get the method for this descriptor.
        Returns:
        the method; never null
      • getDisplayName

        @API(status=STABLE,
             since="5.10")
        java.lang.String getDisplayName()
        Get the display name for this descriptor's method.
        Returns:
        the display name for this descriptor's method; never null or blank
        Since:
        5.7
      • isAnnotated

        boolean isAnnotated​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
        Determine if an annotation of annotationType is either present or meta-present on the Method for this descriptor.
        Parameters:
        annotationType - the annotation type to search for; never null
        Returns:
        true if the annotation is present or meta-present
        See Also:
        findAnnotation(Class), findRepeatableAnnotations(Class)
      • findAnnotation

        <A extends java.lang.annotation.Annotation> java.util.Optional<A> findAnnotation​(java.lang.Class<A> annotationType)
        Find the first annotation of annotationType that is either present or meta-present on the Method for this descriptor.
        Type Parameters:
        A - the annotation type
        Parameters:
        annotationType - the annotation type to search for; never null
        Returns:
        an Optional containing the annotation; never null but potentially empty
        See Also:
        isAnnotated(Class), findRepeatableAnnotations(Class)
      • findRepeatableAnnotations

        <A extends java.lang.annotation.Annotation> java.util.List<A> findRepeatableAnnotations​(java.lang.Class<A> annotationType)
        Find all repeatable annotations of annotationType that are either present or meta-present on the Method for this descriptor.
        Type Parameters:
        A - the annotation type
        Parameters:
        annotationType - the repeatable annotation type to search for; never null
        Returns:
        the list of all such annotations found; neither null nor mutable, but potentially empty
        See Also:
        isAnnotated(Class), findAnnotation(Class), Repeatable