@Test public void testDoesntSupport() throws NoSuchMethodException { MethodParameter methodParameter = new MethodParameter( this.getClass().getMethod("testSupportAndResolve"), 0, Map.class, MethodParameter.EMPTY_ANNOTATIONS ); RequestEnvelope envelope = Utils.buildSimpleEnvelope("PetTypeIntent2", "pet", "DRAGON"); ArgumentResolverContext input = new ArgumentResolverContext(mockSkillContext, methodParameter, HandlerInput.builder().withRequestEnvelope(envelope).build()); assertFalse(resolver.resolve(input).isPresent()); }
@Override public Optional<Object> resolve(ArgumentResolverContext input) { try { if (input.requestTypeEquals(IntentRequest.class)) { Optional<Slot> annotation = input.getMethodParameter().findAnnotation(Slot.class); if (annotation.isPresent()) { return Optional.of(intentMapper.parseIntentSlot((IntentRequest) input.unwrapRequest(), annotation.get().value())); } } } catch (IntentParseException e) { } return Optional.empty(); }
SlotModelArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { try { if (input.requestTypeEquals(IntentRequest.class)) { Optional<Slot> annotation = input.getMethodParameter().findAnnotation(Slot.class); if (annotation.isPresent()) { return Optional.of(intentMapper.parseIntentSlot((IntentRequest) input.unwrapRequest(), annotation.get().value())); } } } catch (IntentParseException e) { } return Optional.empty(); } }
SlotModelArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { try { if (input.requestTypeEquals(IntentRequest.class)) { Optional<Slot> annotation = input.getMethodParameter().findAnnotation(Slot.class); if (annotation.isPresent()) { return Optional.of(intentMapper.parseIntentSlot((IntentRequest) input.unwrapRequest(), annotation.get().value())); } } } catch (IntentParseException e) { } return Optional.empty(); } SlotModelArgumentResolver(IntentMapper intentMapper); }
SlotModelArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { try { if (input.requestTypeEquals(IntentRequest.class)) { Optional<Slot> annotation = input.getMethodParameter().findAnnotation(Slot.class); if (annotation.isPresent()) { return Optional.of(intentMapper.parseIntentSlot((IntentRequest) input.unwrapRequest(), annotation.get().value())); } } } catch (IntentParseException e) { } return Optional.empty(); } SlotModelArgumentResolver(IntentMapper intentMapper); @Override Optional<Object> resolve(ArgumentResolverContext input); }
SlotModelArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { try { if (input.requestTypeEquals(IntentRequest.class)) { Optional<Slot> annotation = input.getMethodParameter().findAnnotation(Slot.class); if (annotation.isPresent()) { return Optional.of(intentMapper.parseIntentSlot((IntentRequest) input.unwrapRequest(), annotation.get().value())); } } } catch (IntentParseException e) { } return Optional.empty(); } SlotModelArgumentResolver(IntentMapper intentMapper); @Override Optional<Object> resolve(ArgumentResolverContext input);  }