class SlotArgumentResolver implements ArgumentResolver {

    @Override
    public Optional<Object> resolve(ArgumentResolverContext input) {
        if (input.requestTypeEquals(IntentRequest.class)
            && input.parameterTypeEquals(Slot.class)
            && input.getMethodParameter().findAnnotation(com.amazon.ask.mvc.annotation.argument.Slot.class).isPresent()) {

            String slotName = input.getMethodParameter().findAnnotation(com.amazon.ask.mvc.annotation.argument.Slot.class).get().value();
            IntentRequest request = (IntentRequest) input.unwrapRequest();
            return Optional.of(request.getIntent().getSlots().get(slotName));
        }
        return Optional.empty();
    }

}