@SuppressWarnings("unchecked") private RequestTemplate addQueryMapQueryParameters(Object[] argv, RequestTemplate mutable) { Map<Object, Object> queryMap = (Map<Object, Object>) argv[metadata.queryMapIndex()]; for (Entry<Object, Object> currEntry : queryMap.entrySet()) { checkState(currEntry.getKey().getClass() == String.class, "QueryMap key must be a String: %s", currEntry.getKey()); Collection<String> values = new ArrayList<String>(); Object currValue = currEntry.getValue(); if (currValue instanceof Iterable<?>) { Iterator<?> iter = ((Iterable<?>) currValue).iterator(); while (iter.hasNext()) { Object nextObject = iter.next(); values.add(nextObject == null ? null : nextObject.toString()); } } else { values.add(currValue == null ? null : currValue.toString()); } mutable.query(metadata.queryMapEncoded(), (String) currEntry.getKey(), values); } return mutable; }
@Override public boolean processArgument(AnnotatedParameterContext context, Annotation annotation, Method method) { int paramIndex = context.getParameterIndex(); MethodMetadata metadata = context.getMethodMetadata(); if (metadata.queryMapIndex() == null) { metadata.queryMapIndex(paramIndex); metadata.queryMapEncoded(SpringQueryMap.class.cast(annotation).encoded()); } return true; } }
@Override public boolean processArgument(AnnotatedParameterContext context, Annotation annotation, Method method) { int paramIndex = context.getParameterIndex(); MethodMetadata metadata = context.getMethodMetadata(); if (metadata.queryMapIndex() == null) { metadata.queryMapIndex(paramIndex); metadata.queryMapEncoded(SpringQueryMap.class.cast(annotation).encoded()); } return true; } }
checkState(data.queryMapIndex() == null, "QueryMap annotation was present on multiple parameters."); data.queryMapIndex(paramIndex); data.queryMapEncoded(QueryMap.class.cast(annotation).encoded()); isHttpAnnotation = true; } else if (annotationType == HeaderMap.class) {