Class OverriddenMethodAnnotationSupport

java.lang.Object
net.jqwik.engine.support.OverriddenMethodAnnotationSupport

public final class OverriddenMethodAnnotationSupport extends Object
Adapted from https://stackoverflow.com/a/49164791/32352
  • Constructor Details

    • OverriddenMethodAnnotationSupport

      public OverriddenMethodAnnotationSupport()
  • Method Details

    • findDeclaredOrInheritedAnnotation

      public static <A extends Annotation> Optional<A> findDeclaredOrInheritedAnnotation(Method m, Class<A> t)
      Returns the optional first element of the list returned by getAnnotations, or null if the list would be empty.
      Type Parameters:
      A - the type of the annotation to find.
      Parameters:
      m - the method to begin the search from.
      t - the type of the annotation to find.
      Returns:
      optional of first annotation found of the specified type which is present on m, or present on any methods which m overrides.
      Throws:
      NullPointerException - if any argument is null.