class SlotValuesArgumentResolver implements ArgumentResolver {

    @Override
    public Optional<Object> resolve(ArgumentResolverContext input) {
        if (input.requestTypeEquals(IntentRequest.class)
            && input.parameterTypeEquals(Map.class)
            && input.getMethodParameter().findAnnotation(SlotValues.class).isPresent()) {

            IntentRequest request = (IntentRequest) input.unwrapRequest();


            return Optional.of(request.getIntent()
                .getSlots().entrySet().stream()
                .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().getValue())));
        } else {
            return Optional.empty();
        }
    }

}