public static < T extends Annotation > T getAnnotationFromType ( final Object instance , Class < T > annotation ) { if ( instance == null || annotation == null ) { return null ; } return instance . getClass ( ) . getAnnotation ( annotation ) ; }
Gets an annotation of passed instance .