static Optional<Class<? extends Annotation>> getAnnotationType(String name) {
        final Class<? extends Annotation> type = ANNOTATION_TYPES.get(name);
        if (type != null) {
            return Optional.of(type);
        } else {
            // last resort, try dynamic load, shouldn't normally happen.
            final Optional<Class> aClass = ClassUtils.forName(name, AnnotationMetadataSupport.class.getClassLoader());
            return aClass.flatMap((Function<Class, Optional<Class<? extends Annotation>>>) aClass1 -> {
                if (Annotation.class.isAssignableFrom(aClass1)) {
                    //noinspection unchecked
                    ANNOTATION_TYPES.put(name, aClass1);
                    return Optional.of(aClass1);
                }
                return Optional.empty();
            });
        }
    }
static Optional < Class < ? extends Annotation > > getAnnotationType ( String name ) { final Class < ? extends Annotation > type = ANNOTATION_TYPES . get ( name ) ; if ( type != null ) { return Optional . of ( type ) ; } else { final Optional < Class > aClass = ClassUtils . forName ( name , AnnotationMetadataSupport . class . getClassLoader ( ) ) ; return aClass . flatMap ( ( Function < Class , Optional < Class < ? extends Annotation > > > ) aClass1 -> { if ( Annotation . class . isAssignableFrom ( aClass1 ) ) { ANNOTATION_TYPES . put ( name , aClass1 ) ; return Optional . of ( aClass1 ) ; } return Optional . empty ( ) ; } ) ; } }
Gets a registered annotation type.

@param name The name of the annotation type
@return The annotation