
com.jparams.junit4.reflection.MethodParameter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jparams-junit4 Show documentation
Show all versions of jparams-junit4 Show documentation
Parameterized JUnit4 Tests
package com.jparams.junit4.reflection;
import java.lang.annotation.Annotation;
public class MethodParameter {
private final Class> type;
private final Annotation[] annotations;
public MethodParameter(Class> type, Annotation[] annotations) {
this.type = type;
this.annotations = annotations;
}
public Class> getType() {
return type;
}
public boolean isAnnotationPresent(Class type) {
return getAnnotation(type) != null;
}
public T getAnnotation(Class type) {
for (Annotation annotation : annotations) {
if (annotation.annotationType().equals(type)) {
return (T) annotation;
}
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy