private static Map < String , Object > changeAnnotationValuesToMap ( Annotation annotation , Class < ? extends Annotation > type ) { Map < String , Object > result = new HashMap < String , Object > ( ) ; result . put ( "AnnotationExist" , true ) ; for ( Method method : type . getDeclaredMethods ( ) ) try { result . put ( method . getName ( ) , method . invoke ( annotation , ( Object [ ] ) null ) ) ; } catch ( Exception e ) { // NOSONAR } return result ; }
Change Annotation fields values into a Map