class RequestArgumentResolver implements ArgumentResolver {

    @Override
    public Optional<Object> resolve(ArgumentResolverContext input) {
        if (Request.class.isAssignableFrom(input.getMethodParameter().getType()) && (input.parameterTypeEquals(input.unwrapRequest().getClass()))) {
            return Optional.of(input.getHandlerInput().getRequestEnvelope().getRequest());
        }
        return Optional.empty();
    }

}