@Test void testRunQueryWithProvidedOptional() throws Exception { Object actual = testSubject.handle(new GenericQueryMessage<>("hello", "Hello", ResponseTypes.instanceOf(String.class))); assertEquals("hello", actual); }
@Override public Object handle(QueryMessage<?, ?> message) throws Exception { MessageHandlingMember<? super T> handler = model.getHandlers(target.getClass()).filter(m -> m.canHandle(message)) .findFirst() .orElseThrow(() -> new NoHandlerForQueryException("No suitable handler was found for the query of type " + message.getPayloadType().getName())); return model.chainedInterceptor(target.getClass()).handle(message, target, handler); }
AnnotationQueryHandlerAdapter implements QueryHandlerAdapter,
        MessageHandler<QueryMessage<?, ?>> { @Override public Object handle(QueryMessage<?, ?> message) throws Exception { MessageHandlingMember<? super T> handler = model.getHandlers(target.getClass()).filter(m -> m.canHandle(message)) .findFirst() .orElseThrow(() -> new NoHandlerForQueryException("No suitable handler was found for the query of type " + message.getPayloadType().getName())); return model.chainedInterceptor(target.getClass()).handle(message, target, handler); } }
AnnotationQueryHandlerAdapter implements QueryHandlerAdapter,
        MessageHandler<QueryMessage<?, ?>> { @Override public Object handle(QueryMessage<?, ?> message) throws Exception { MessageHandlingMember<? super T> handler = model.getHandlers(target.getClass()).filter(m -> m.canHandle(message)) .findFirst() .orElseThrow(() -> new NoHandlerForQueryException("No suitable handler was found for the query of type " + message.getPayloadType().getName())); return model.chainedInterceptor(target.getClass()).handle(message, target, handler); } AnnotationQueryHandlerAdapter(T target);  AnnotationQueryHandlerAdapter(T target, ParameterResolverFactory parameterResolverFactory); @SuppressWarnings("unchecked")  AnnotationQueryHandlerAdapter(T target, ParameterResolverFactory parameterResolverFactory,
                                         HandlerDefinition handlerDefinition); }
AnnotationQueryHandlerAdapter implements QueryHandlerAdapter,
        MessageHandler<QueryMessage<?, ?>> { @Override public Object handle(QueryMessage<?, ?> message) throws Exception { MessageHandlingMember<? super T> handler = model.getHandlers(target.getClass()).filter(m -> m.canHandle(message)) .findFirst() .orElseThrow(() -> new NoHandlerForQueryException("No suitable handler was found for the query of type " + message.getPayloadType().getName())); return model.chainedInterceptor(target.getClass()).handle(message, target, handler); } AnnotationQueryHandlerAdapter(T target);  AnnotationQueryHandlerAdapter(T target, ParameterResolverFactory parameterResolverFactory); @SuppressWarnings("unchecked")  AnnotationQueryHandlerAdapter(T target, ParameterResolverFactory parameterResolverFactory,
                                         HandlerDefinition handlerDefinition); Registration subscribe(QueryBus queryBus); @Override Object handle(QueryMessage<?, ?> message); @Override boolean canHandle(QueryMessage<?, ?> message); }
AnnotationQueryHandlerAdapter implements QueryHandlerAdapter,
        MessageHandler<QueryMessage<?, ?>> { @Override public Object handle(QueryMessage<?, ?> message) throws Exception { MessageHandlingMember<? super T> handler = model.getHandlers(target.getClass()).filter(m -> m.canHandle(message)) .findFirst() .orElseThrow(() -> new NoHandlerForQueryException("No suitable handler was found for the query of type " + message.getPayloadType().getName())); return model.chainedInterceptor(target.getClass()).handle(message, target, handler); } AnnotationQueryHandlerAdapter(T target);  AnnotationQueryHandlerAdapter(T target, ParameterResolverFactory parameterResolverFactory); @SuppressWarnings("unchecked")  AnnotationQueryHandlerAdapter(T target, ParameterResolverFactory parameterResolverFactory,
                                         HandlerDefinition handlerDefinition); Registration subscribe(QueryBus queryBus); @Override Object handle(QueryMessage<?, ?> message); @Override boolean canHandle(QueryMessage<?, ?> message);  }