All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.asciidoctor.arquillian.AnnotationUtils Maven / Gradle / Ivy

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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy