@Override public PagedIterable<T> apply(IterableWithMarker<T> input) { if (input.nextMarker() == null) return PagedIterables.of(input); Optional<String> arg0Option = Optional.absent(); if (request.getCaller().get().getArgs().size() > 0) { Object arg0 = request.getCaller().get().getArgs().get(0); if (arg0 != null) arg0Option = Optional.of(arg0.toString()); } final String arg0 = arg0Option.orNull(); return PagedIterables.advance(input, markerToNextForCallingArg0(arg0)); }
@Override public PagedIterable<T> apply(IterableWithMarker<T> input) { if (!input.nextMarker().isPresent()) return onlyPage(input); List<Object> args = getArgs(request); Optional<Object> arg0 = Optional.fromNullable(args.size() > 0 ? args.get(0) : null); return advance(input, markerToNextForArg0(arg0)); }
/** * List metrics based on the criteria in the {@link ListMetricsOptions} passed in. * * @param metricApi the {@link MetricApi} to use for the request * @param options the {@link ListMetricsOptions} describing the ListMetrics request * * @return iterable of metrics fitting the criteria */ public static Iterable<Metric> listMetrics(final MetricApi metricApi, final ListMetricsOptions options) { return Iterables.concat(PagedIterables.advance(metricApi.list(options), new Function<Object, IterableWithMarker<Metric>>() { @Override public IterableWithMarker<Metric> apply(Object input) { return metricApi.list(options.clone().afterMarker(input)); } @Override public String toString() { return "listMetrics(" + options + ")"; } })); }
/** * @see #onlyPage(IterableWithMarker) */ @Deprecated public static <T> PagedIterable<T> of(IterableWithMarker<T> only) { return onlyPage(only); }
public PagedIterable<Object> createOrPropagate(Throwable t) throws Exception { return valOnNotFoundOr404(PagedIterables.of(IterableWithMarkers.from(ImmutableSet.of())), checkNotNull(t, "throwable")); } }
/** * List metrics based on the criteria in the {@link ListMetricsOptions} passed in. * * @param metricApi the {@link MetricApi} to use for the request * @param options the {@link ListMetricsOptions} describing the ListMetrics request * * @return iterable of metrics fitting the criteria */ public static Iterable<Metric> listMetrics(final MetricApi metricApi, final ListMetricsOptions options) { return Iterables.concat(PagedIterables.advance(metricApi.list(options), new Function<Object, IterableWithMarker<Metric>>() { @Override public IterableWithMarker<Metric> apply(Object input) { return metricApi.list(options.clone().afterMarker(input)); } @Override public String toString() { return "listMetrics(" + options + ")"; } })); }
/** * @see #onlyPage(IterableWithMarker) */ @Deprecated public static <T> PagedIterable<T> of(IterableWithMarker<T> only) { return onlyPage(only); }
public PagedIterable<Object> createOrPropagate(Throwable t) throws Exception { return valOnNotFoundOr404(PagedIterables.of(IterableWithMarkers.from(ImmutableSet.of())), checkNotNull(t, "throwable")); } }
@Override public PagedIterable<T> apply(IterableWithMarker<T> input) { if (input.nextMarker() == null) return PagedIterables.of(input); Optional<String> arg0Option = Optional.absent(); if (request.getCaller().get().getArgs().size() > 0) { Object arg0 = request.getCaller().get().getArgs().get(0); if (arg0 != null) arg0Option = Optional.of(arg0.toString()); } final String arg0 = arg0Option.orNull(); return PagedIterables.advance(input, markerToNextForCallingArg0(arg0)); }
/** * List metrics based on the criteria in the {@link ListMetricsOptions} passed in. * * @param metricApi the {@link MetricApi} to use for the request * @param options the {@link ListMetricsOptions} describing the ListMetrics request * * @return iterable of metrics fitting the criteria */ public static Iterable<Metric> listMetrics(final MetricApi metricApi, final ListMetricsOptions options) { return Iterables.concat(PagedIterables.advance(metricApi.list(options), new Function<Object, IterableWithMarker<Metric>>() { @Override public IterableWithMarker<Metric> apply(Object input) { return metricApi.list(options.clone().afterMarker(input)); } @Override public String toString() { return "listMetrics(" + options + ")"; } })); }
@Override public PagedIterable<T> apply(IterableWithMarker<T> input) { if (!input.nextMarker().isPresent()) return onlyPage(input); List<Object> args = getArgs(request); Optional<Object> arg0 = Optional.fromNullable(args.size() > 0 ? args.get(0) : null); return advance(input, markerToNextForArg0(arg0)); }
/** * @see #onlyPage(IterableWithMarker) */ @Deprecated public static <T> PagedIterable<T> of(IterableWithMarker<T> only) { return onlyPage(only); }
public PagedIterable<Object> createOrPropagate(Throwable t) throws Exception { return valOnNotFoundOr404(PagedIterables.of(IterableWithMarkers.from(ImmutableSet.of())), checkNotNull(t, "throwable")); } }
@Override public PagedIterable<T> apply(IterableWithMarker<T> input) { if (input.nextMarker() == null) return PagedIterables.of(input); Optional<String> arg0Option = Optional.absent(); if (request.getCaller().get().getArgs().size() > 0) { Object arg0 = request.getCaller().get().getArgs().get(0); if (arg0 != null) arg0Option = Optional.of(arg0.toString()); } final String arg0 = arg0Option.orNull(); return PagedIterables.advance(input, markerToNextForCallingArg0(arg0)); }
/** * List metrics based on the criteria in the {@link ListMetricsOptions} passed in. * * @param metricApi the {@link MetricApi} to use for the request * @param options the {@link ListMetricsOptions} describing the ListMetrics request * * @return iterable of metrics fitting the criteria */ public static Iterable<Metric> listMetrics(final MetricApi metricApi, final ListMetricsOptions options) { return Iterables.concat(PagedIterables.advance(metricApi.list(options), new Function<Object, IterableWithMarker<Metric>>() { @Override public IterableWithMarker<Metric> apply(Object input) { return metricApi.list(options.clone().afterMarker(input)); } @Override public String toString() { return "listMetrics(" + options + ")"; } })); }
/** * @see #onlyPage(IterableWithMarker) */ @Deprecated public static <T> PagedIterable<T> of(IterableWithMarker<T> only) { return onlyPage(only); }
public PagedIterable<Object> createOrPropagate(Throwable t) throws Exception { return valOnNotFoundOr404(PagedIterables.of(IterableWithMarkers.from(ImmutableSet.of())), checkNotNull(t, "throwable")); } }
@Override public PagedIterable<T> apply(IterableWithMarker<T> input) { if (input.nextMarker() == null) return PagedIterables.of(input); Optional<String> arg0Option = Optional.absent(); if (!request.getCaller().get().getArgs().isEmpty()) { Object arg0 = request.getCaller().get().getArgs().get(0); if (arg0 != null) arg0Option = Optional.of(arg0.toString()); } final String arg0 = arg0Option.orNull(); return PagedIterables.advance(input, markerToNextForCallingArg0(arg0)); }
/** * List metrics based on the criteria in the {@link ListMetricsOptions} passed in. * * @param metricApi the {@link MetricApi} to use for the request * @param options the {@link ListMetricsOptions} describing the ListMetrics request * * @return iterable of metrics fitting the criteria */ public static Iterable<Metric> listMetrics(final MetricApi metricApi, final ListMetricsOptions options) { return Iterables.concat(PagedIterables.advance(metricApi.list(options), new Function<Object, IterableWithMarker<Metric>>() { @Override public IterableWithMarker<Metric> apply(Object input) { return metricApi.list(options.clone().afterMarker(input)); } @Override public String toString() { return "listMetrics(" + options + ")"; } })); }