Predicate that matches RequestHandler with given annotation on the declaring class of the handler method

@param annotation - annotation to check
@return this
507461
public static Predicate<RequestHandler> withClassAnnotation(final Class<? extends Annotation> annotation) {
    return input -> declaringClass(input).map(annotationPresent(annotation)).orElse(false);
  }
1119676
@Bean
	@ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "spring-monitoring-enabled", matchIfMissing = true)
	public MonitoringSpringAdvisor monitoringSpringServiceAdvisor() {
		return new MonitoringSpringAdvisor(new AnnotationMatchingPointcut(Service.class));
	}
862834
public Set<Constructor> getConstructorsAnnotatedWith(final Annotation annotation) {
        return filter(getConstructorsAnnotatedWith(annotation.annotationType()), withAnnotation(annotation));
    }
1107410
@Api
	public HandlerRegistration addFeatureTransactionHandler(final FeatureTransactionHandler handler) {
		return handlerManager.addHandler(FeatureTransactionHandler.TYPE, handler);
	}
157633
public static List<Method> getAllAnnotationPresentMethod(Class<?> type,
                                                             Class<? extends Annotation> annotation) {
        List<Method> methods = getAllMethod(type);

        if (methods.isEmpty()) {
            return Collections.emptyList();
        }

        return methods.stream().filter(method -> method.isAnnotationPresent(annotation))
            .collect(Collectors.toList());
    }
380088
public RouteMatcher get(String pattern, Handler<HttpServerRequest> handler) {
		addPattern(pattern, handler, getBindings);
		return this;
	}
1369561
public static boolean isAnnotationPresent(Class<?> target, Class<? extends Annotation> annotation) {
        Class<?> clazz = target;
        if (clazz.isAnnotationPresent(annotation)) {
            return true;
        }
        while((clazz = clazz.getSuperclass()) != null) {
            if (clazz.isAnnotationPresent(annotation)) {
                return true;
            }
        }
        return false;
    }
907669
public static Predicate<Field> isAnnotatedWith(Class<? extends Annotation>... annotations) {
        return field -> {
            for (Class<? extends Annotation> annotation : annotations) {
                if (field.isAnnotationPresent(annotation)) {
                    return true;
                }
            }
            return false;
        };
    }
1251148
public Set<Method> getMethodsWithAnyParamAnnotated(Annotation annotation) {
        return filter(getMethodsWithAnyParamAnnotated(annotation.annotationType()), withAnyParameterAnnotation(annotation));
    }
1169361
public Set<Method> getMethodsWithAnyParamAnnotated(Class<? extends Annotation> annotation) {
        return getMethodsFromDescriptors(store.get(index(MethodParameterScanner.class), annotation.getName()), loaders());

    }
451398
public static Predicate<Annotation> annotationIsOfClass(final Class<? extends Annotation> annotationClass) {
        return candidate -> candidate != null && candidate.annotationType().equals(annotationClass);
    }
1205074
public static <T extends Annotation> Optional<T> getAnnotation( String annotation, List<? extends HasAnnotations>
            hasAnnotationsList ) {
        try {
            Class clazz = Class.forName( annotation );
            return getAnnotation( clazz, hasAnnotationsList );
        } catch ( ClassNotFoundException e ) {
            return Optional.absent();
        }
    }
666029
public void setHandler(Object handler){
        if(handler instanceof ContentHandler)
            setContentHandler((ContentHandler)handler);
        if(handler instanceof EntityResolver)
            setEntityResolver((EntityResolver)handler);
        if(handler instanceof ErrorHandler)
            setErrorHandler((ErrorHandler)handler);
        if(handler instanceof DTDHandler)
            setDTDHandler((DTDHandler)handler);
        if(handler instanceof LexicalHandler)
            setLexicalHandler((LexicalHandler)handler);
        if(handler instanceof DeclHandler)
            setDeclHandler((DeclHandler)handler);
    }
911734
public static Predicate<RequestHandler> basePackage(final String basePackage) {
    return input -> declaringClass(input).map(handlerPackage(basePackage)).orElse(true);
  }
231164
@SuppressWarnings("unchecked")
    public <H extends CompletionHandler> H createAsyncHandler(Class<H> handlerClass) {
        if (handlerClass == null || handlerClass == CompletionHandler.class) return (H) createAsyncHandler();
        return context.loadAsyncHandlerCreator(handlerClass).create(createAsyncHandler());
    }
316886
public static <T extends AnnotationDescription> ElementMatcher.Junction<T> annotationType(ElementMatcher<? super TypeDescription> matcher) {
        return new AnnotationTypeMatcher<T>(matcher);
    }
1055079
public <T extends Annotation> Optional<T> getAnnotation( String annotation ) {
        return CreatorUtils.getAnnotation( annotation, accessors );
    }