org.asciidoctor.arquillian.AnnotationUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of asciidoctorj-arquillian-extension Show documentation
Show all versions of asciidoctorj-arquillian-extension Show documentation
An Arquillian extension that injects Asciidoctor instances as ArquillianResource
The newest version!
package org.asciidoctor.arquillian;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.List;
public final class AnnotationUtils {
private AnnotationUtils() {}
@SuppressWarnings("unchecked")
public static T filterAnnotation(Annotation[] annotations, Class annotationClass) {
if(annotations == null) {
return null;
}
List filtered = new ArrayList();
for(Annotation annotation : annotations) {
if(annotationClass.isInstance(annotation)) {
return (T) annotation;
}
}
return null;
}
}