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

hsim.checkpoint.util.AnnotationUtil Maven / Gradle / Ivy

There is a newer version: 0.1.2
Show newest version
package hsim.checkpoint.util;

import java.lang.annotation.Annotation;
import java.util.Arrays;

/**
 * The type Annotation util.
 */
public class AnnotationUtil {

    /**
     * Gets annotation.
     *
     * @param annotations     the annotations
     * @param annotationClass the annotation class
     * @return the annotation
     */
    public static Annotation getAnnotation(Annotation[] annotations, Class annotationClass) {
        return Arrays.stream(annotations).filter(annotation -> annotation.annotationType().equals(annotationClass)).findFirst().orElse(null);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy