Java examples for java.lang.annotation:Annotation Attribute
find Annotation from Annotation array
//package com.java2s; import java.lang.annotation.Annotation; public class Main { @SuppressWarnings("unchecked") public static <T> T find(Annotation[] array, Class<T> type) { for (Annotation annotation : array) { if (annotation.annotationType().equals(type)) { return (T) annotation; }/*from www . j a va 2s . com*/ } return null; } }