net.jqwik.engine.support.MethodParameter Maven / Gradle / Ivy
package net.jqwik.engine.support;
import java.lang.annotation.*;
import java.lang.reflect.*;
import java.util.*;
import org.junit.platform.commons.support.*;
public class MethodParameter {
private final Parameter parameter;
private final TypeResolution resolution;
public MethodParameter(Parameter parameter, TypeResolution resolution) {
this.parameter = parameter;
this.resolution = resolution;
}
public boolean isAnnotatedParameterized() {
return (resolution.annotatedType() instanceof AnnotatedParameterizedType);
}
public boolean isAnnotated(Class extends Annotation> annotationType) {
return AnnotationSupport.isAnnotated(parameter, annotationType);
}
public T getAnnotation(Class annotationClass) {
return findAnnotation(annotationClass).orElse(null);
}
public Optional findAnnotation(Class annotationClass) {
return AnnotationSupport.findAnnotation(parameter, annotationClass);
}
public Type getType() {
return resolution.type();
}
@Override
public String toString() {
return parameter.toString();
}
public List findAllAnnotations() {
return JqwikAnnotationSupport.findAllAnnotations(parameter);
}
public AnnotatedParameterizedType getAnnotatedType() {
if (isAnnotatedParameterized())
return (AnnotatedParameterizedType) resolution.annotatedType();
else
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy