private static Collection<Parameter> parametersWithAnnotation(Invokable<?, ?> invokable, final Class<? extends Annotation> annotationType) { return filter(getInvokableParameters(invokable), new Predicate<Parameter>() { public boolean apply(Parameter in) { return in.isAnnotationPresent(annotationType); } }); }
private static Collection<Parameter> parametersWithAnnotation(Invokable<?, ?> invokable, final Class<? extends Annotation> annotationType) { return filter(getInvokableParameters(invokable), new Predicate<Parameter>() { public boolean apply(Parameter in) { return in.isAnnotationPresent(annotationType); } }); }
private static Collection<Parameter> parametersWithAnnotation(Invokable<?, ?> invokable, final Class<? extends Annotation> annotationType) { return filter(getInvokableParameters(invokable), new Predicate<Parameter>() { public boolean apply(Parameter in) { return in.isAnnotationPresent(annotationType); } }); }
private static Collection<Parameter> parametersWithAnnotation(Invokable<?, ?> invokable, final Class<? extends Annotation> annotationType) { return filter(getInvokableParameters(invokable), new Predicate<Parameter>() { public boolean apply(Parameter in) { return in.isAnnotationPresent(annotationType); } }); }
@Override public Set<Integer> load(Invokable<?, ?> invokable) { Builder<Integer> toReturn = ImmutableSet.builder(); for (Parameter param : getInvokableParameters(invokable)) { Class<?> type = param.getType().getRawType(); if (HttpRequestOptions.class.isAssignableFrom(type) || HttpRequestOptions[].class.isAssignableFrom(type)) toReturn.add(param.hashCode()); } return toReturn.build(); } });
@Override public Set<Integer> load(Invokable<?, ?> invokable) { Builder<Integer> toReturn = ImmutableSet.builder(); for (Parameter param : getInvokableParameters(invokable)) { Class<?> type = param.getType().getRawType(); if (HttpRequestOptions.class.isAssignableFrom(type) || HttpRequestOptions[].class.isAssignableFrom(type)) toReturn.add(param.hashCode()); } return toReturn.build(); } });
@Override public Set<Integer> load(Invokable<?, ?> invokable) { Builder<Integer> toReturn = ImmutableSet.builder(); for (Parameter param : getInvokableParameters(invokable)) { Class<?> type = param.getType().getRawType(); if (HttpRequestOptions.class.isAssignableFrom(type) || HttpRequestOptions[].class.isAssignableFrom(type)) toReturn.add(param.hashCode()); } return toReturn.build(); } });
@Override public Set<Integer> load(Invokable<?, ?> invokable) { Builder<Integer> toReturn = ImmutableSet.builder(); for (Parameter param : getInvokableParameters(invokable)) { Class<?> type = param.getType().getRawType(); if (HttpRequestOptions.class.isAssignableFrom(type) || HttpRequestOptions[].class.isAssignableFrom(type)) toReturn.add(param.hashCode()); } return toReturn.build(); } });
public static String getBucketName(HttpRequest req) { checkArgument(req instanceof GeneratedHttpRequest, "this should be a generated http request"); GeneratedHttpRequest request = GeneratedHttpRequest.class.cast(req); String bucketName = null; List<Parameter> parameters = Reflection2.getInvokableParameters(request.getInvocation().getInvokable()); for (int i = 0; i < parameters.size(); i++) { if (any(Arrays.asList(parameters.get(i).getAnnotations()), ANNOTATIONTYPE_BUCKET)) { bucketName = (String) request.getInvocation().getArgs().get(i); break; } } return bucketName; }
private boolean checkPresentOrNullable(Invocation invocation, String paramKey, int argIndex, Object arg) { if (arg == null && !getInvokableParameters(invocation.getInvokable()).get(argIndex).isAnnotationPresent(Nullable.class)) throw new NullPointerException(format("param{%s} for invocation %s.%s", paramKey, invocation.getInvokable() .getOwnerType().getRawType().getSimpleName(), invocation.getInvokable().getName())); return true; }
public static String getBucketName(HttpRequest req) { checkArgument(req instanceof GeneratedHttpRequest, "this should be a generated http request"); GeneratedHttpRequest request = GeneratedHttpRequest.class.cast(req); String bucketName = null; List<Parameter> parameters = Reflection2.getInvokableParameters(request.getInvocation().getInvokable()); for (int i = 0; i < parameters.size(); i++) { if (any(Arrays.asList(parameters.get(i).getAnnotations()), ANNOTATIONTYPE_BUCKET)) { bucketName = (String) request.getInvocation().getArgs().get(i); break; } } return bucketName; }
public static String getBucketName(HttpRequest req) { checkArgument(req instanceof GeneratedHttpRequest, "this should be a generated http request"); GeneratedHttpRequest request = GeneratedHttpRequest.class.cast(req); String bucketName = null; List<Parameter> parameters = Reflection2.getInvokableParameters(request.getInvocation().getInvokable()); for (int i = 0; i < parameters.size(); i++) { if (any(Arrays.asList(parameters.get(i).getAnnotations()), ANNOTATIONTYPE_BUCKET)) { bucketName = (String) request.getInvocation().getArgs().get(i); break; } } return bucketName; }
private boolean checkPresentOrNullable(Invocation invocation, String paramKey, int argIndex, Object arg) { if (arg == null && !getInvokableParameters(invocation.getInvokable()).get(argIndex).isAnnotationPresent(Nullable.class)) throw new NullPointerException(format("param{%s} for invocation %s.%s", paramKey, invocation.getInvokable() .getOwnerType().getRawType().getSimpleName(), invocation.getInvokable().getName())); return true; }
private boolean checkPresentOrNullable(Invocation invocation, String paramKey, int argIndex, Object arg) { if (arg == null && !getInvokableParameters(invocation.getInvokable()).get(argIndex).isAnnotationPresent(Nullable.class)) throw new NullPointerException(format("param{%s} for invocation %s.%s", paramKey, invocation.getInvokable() .getOwnerType().getRawType().getSimpleName(), invocation.getInvokable().getName())); return true; }
private boolean checkPresentOrNullable(Invocation invocation, String paramKey, int argIndex, Object arg) { if (arg == null && !getInvokableParameters(invocation.getInvokable()).get(argIndex).isAnnotationPresent(Nullable.class)) throw new NullPointerException(format("param{%s} for invocation %s.%s", paramKey, invocation.getInvokable() .getOwnerType().getRawType().getSimpleName(), invocation.getInvokable().getName())); return true; }
int arrayLength = args.size() - getInvokableParameters(invocation.getInvokable()).size() + 1; if (arrayLength == 0) break OUTER; break OUTER; } else { if (position + 1 == getInvokableParameters(invocation.getInvokable()).size() && entry.getType().isArray())// TODO:
int arrayLength = args.size() - getInvokableParameters(invocation.getInvokable()).size() + 1; if (arrayLength == 0) break OUTER; break OUTER; } else { if (position + 1 == getInvokableParameters(invocation.getInvokable()).size() && entry.getType().isArray())// TODO:
int arrayLength = args.size() - getInvokableParameters(invocation.getInvokable()).size() + 1; if (arrayLength == 0) break OUTER; break OUTER; } else { if (position + 1 == getInvokableParameters(invocation.getInvokable()).size() && entry.getType().isArray())// TODO:
int arrayLength = args.size() - getInvokableParameters(invocation.getInvokable()).size() + 1; if (arrayLength == 0) break OUTER; break OUTER; } else { if (position + 1 == getInvokableParameters(invocation.getInvokable()).size() && entry.getType().isArray())// TODO:
@Override public GeneratedHttpRequest apply(Invocation invocation) { checkNotNull(invocation, "invocation"); inputParamValidator.validateMethodParametersOrThrow(invocation, getInvokableParameters(invocation.getInvokable()));