/** * Create {@link RolesAllowed} annotation implementation for given set of roles. * * @param roles roles to be part of the annotation. * @return annotation implementation. */ public static RolesAllowed rolesAllowed(final String... roles) { final List<String> list = Lists.newArrayListWithCapacity(roles.length); for (final String role : roles) { if (role != null) { list.add(role); } } return new RolesAllowedImpl(list.toArray(new String[list.size()])); }
/** * Create {@link RolesAllowed} annotation implementation for given set of roles. * * @param roles roles to be part of the annotation. * @return annotation implementation. */ public static RolesAllowed rolesAllowed(final String... roles) { final List<String> list = Lists.newArrayListWithCapacity(roles.length); for (final String role : roles) { if (role != null) { list.add(role); } } return new RolesAllowedImpl(list.toArray(new String[list.size()])); }
private static List<ResourceMethod> getMatchedMethods(final ExtendedUriInfo uriInfo) { final List<ResourceMethod> matchedResourceLocators = uriInfo.getMatchedResourceLocators(); final List<ResourceMethod> methods = Lists.newArrayListWithCapacity(1 + matchedResourceLocators.size()); methods.add(uriInfo.getMatchedResourceMethod()); methods.addAll(matchedResourceLocators); return methods; } }
private static List<ResourceMethod> getMatchedMethods(final ExtendedUriInfo uriInfo) { final List<ResourceMethod> matchedResourceLocators = uriInfo.getMatchedResourceLocators(); final List<ResourceMethod> methods = Lists.newArrayListWithCapacity(1 + matchedResourceLocators.size()); methods.add(uriInfo.getMatchedResourceMethod()); methods.addAll(matchedResourceLocators); return methods; } }
CombinedFuture( ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed, Executor listenerExecutor, FutureCombiner<V, C> combiner) { this.futures = futures; this.allMustSucceed = allMustSucceed; this.remaining = new AtomicInteger(futures.size()); this.combiner = combiner; this.values = Lists.newArrayListWithCapacity(futures.size()); init(listenerExecutor); }
CombinedFuture( ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed, Executor listenerExecutor, FutureCombiner<V, C> combiner) { this.futures = futures; this.allMustSucceed = allMustSucceed; this.remaining = new AtomicInteger(futures.size()); this.combiner = combiner; this.values = Lists.newArrayListWithCapacity(futures.size()); init(listenerExecutor); }
CombinedFuture( ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed, Executor listenerExecutor, FutureCombiner<V, C> combiner) { this.futures = futures; this.allMustSucceed = allMustSucceed; this.remaining = new AtomicInteger(futures.size()); this.combiner = combiner; this.values = Lists.newArrayListWithCapacity(futures.size()); init(listenerExecutor); }
CombinedFuture( ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed, Executor listenerExecutor, FutureCombiner<V, C> combiner) { this.futures = futures; this.allMustSucceed = allMustSucceed; this.remaining = new AtomicInteger(futures.size()); this.combiner = combiner; this.values = Lists.newArrayListWithCapacity(futures.size()); init(listenerExecutor); }
int ntasks = tasks.size(); checkArgument(ntasks > 0); List<Future<T>> futures = Lists.newArrayListWithCapacity(ntasks); BlockingQueue<Future<T>> futureQueue = Queues.newLinkedBlockingQueue();
int ntasks = tasks.size(); checkArgument(ntasks > 0); List<Future<T>> futures = Lists.newArrayListWithCapacity(ntasks); BlockingQueue<Future<T>> futureQueue = Queues.newLinkedBlockingQueue();
int ntasks = tasks.size(); checkArgument(ntasks > 0); List<Future<T>> futures = Lists.newArrayListWithCapacity(ntasks); BlockingQueue<Future<T>> futureQueue = Queues.newLinkedBlockingQueue();
int ntasks = tasks.size(); checkArgument(ntasks > 0); List<Future<T>> futures = Lists.newArrayListWithCapacity(ntasks); BlockingQueue<Future<T>> futureQueue = Queues.newLinkedBlockingQueue();