Package net.jqwik.engine.support
Class OverriddenMethodAnnotationSupport
java.lang.Object
net.jqwik.engine.support.OverriddenMethodAnnotationSupport
Adapted from https://stackoverflow.com/a/49164791/32352
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <A extends Annotation>
Optional<A>findDeclaredOrInheritedAnnotation(Method m, Class<A> t) Returns the optional first element of the list returned bygetAnnotations, ornullif the list would be empty.
-
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 bygetAnnotations, ornullif 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 whichmoverrides. - Throws:
NullPointerException- if any argument isnull.
-