State newState = new State(); newState.level0Files = (this.level0Files == null) ? oldState.level0Files : ImmutableList.copyOf(this.level0Files); newState.stripeEndRows = (this.stripeEndRows == null) ? oldState.stripeEndRows : this.stripeEndRows.toArray(new byte[this.stripeEndRows.size()][]); for (List<HStoreFile> newStripe : this.stripeFiles) { newState.stripeFiles.add(newStripe instanceof ImmutableList<?> ? (ImmutableList<HStoreFile>)newStripe : ImmutableList.copyOf(newStripe)); newAllFiles.addAll(results); newState.allFilesCached = ImmutableList.copyOf(newAllFiles); newState.allCompactedFilesCached = ImmutableList.copyOf(newAllCompactedFiles); return newState;
state.level0Files = ImmutableList.copyOf(level0Files); state.stripeFiles = new ArrayList<>(candidateStripes.size()); state.stripeEndRows = new byte[Math.max(0, candidateStripes.size() - 1)][]; int i = candidateStripes.size() - 1; for (Map.Entry<byte[], ArrayList<HStoreFile>> entry : candidateStripes.entrySet()) { state.stripeFiles.add(ImmutableList.copyOf(entry.getValue())); newAllFiles.addAll(entry.getValue()); if (i > 0) { state.allFilesCached = ImmutableList.copyOf(newAllFiles); this.state = state; debugDumpState("Files loaded");
setFileStripe(sf, startKey, endKey); stripes.add(ImmutableList.copyOf(stripeFiles.get(i))); when(si.getStartRow(eq(i))).thenReturn(startKey); when(si.getEndRow(eq(i))).thenReturn(endKey);
this, ImmutableList.copyOf(compaction.getRequest().getFiles()), tracker, compaction.getRequest(), user);
Parameter( Invokable<?, ?> declaration, int position, TypeToken<?> type, Annotation[] annotations) { this.declaration = declaration; this.position = position; this.type = type; this.annotations = ImmutableList.copyOf(annotations); }
@Override public <E> ImmutableList<E> immutableSortedCopy(Iterable<E> iterable) { return ImmutableList.copyOf(iterable); }
Object readResolve() { return copyOf(elements); }
CompoundOrdering(Iterable<? extends Comparator<? super T>> comparators) { this.comparators = ImmutableList.copyOf(comparators); }
/** * Returns an immutable list containing the given elements, in order. If * {@code elements} is a {@link Collection}, this method behaves exactly as * {@link #copyOf(Collection)}; otherwise, it behaves exactly as {@code * copyOf(elements.iterator()}. * * @throws NullPointerException if any of {@code elements} is null */ public static <E> ImmutableList<E> copyOf(Iterable<? extends E> elements) { checkNotNull(elements); // TODO(kevinb): is this here only for GWT? return (elements instanceof Collection) ? copyOf((Collection<? extends E>) elements) : copyOf(elements.iterator()); }
/** * Creates a {@link FutureCombiner} that processes the completed futures whether or not they're * successful. * * @since 20.0 */ @SafeVarargs public static <V> FutureCombiner<V> whenAllComplete(ListenableFuture<? extends V>... futures) { return new FutureCombiner<V>(false, ImmutableList.copyOf(futures)); }
/** * Creates a {@link FutureCombiner} that processes the completed futures whether or not they're * successful. * * @since 20.0 */ public static <V> FutureCombiner<V> whenAllComplete( Iterable<? extends ListenableFuture<? extends V>> futures) { return new FutureCombiner<V>(false, ImmutableList.copyOf(futures)); }
/** * Creates a {@link FutureCombiner} requiring that all passed in futures are successful. * * <p>If any input fails, the returned future fails immediately. * * @since 20.0 */ public static <V> FutureCombiner<V> whenAllSucceed( Iterable<? extends ListenableFuture<? extends V>> futures) { return new FutureCombiner<V>(true, ImmutableList.copyOf(futures)); }
/** * Creates a {@link FutureCombiner} requiring that all passed in futures are successful. * * <p>If any input fails, the returned future fails immediately. * * @since 20.0 */ @SafeVarargs public static <V> FutureCombiner<V> whenAllSucceed(ListenableFuture<? extends V>... futures) { return new FutureCombiner<V>(true, ImmutableList.copyOf(futures)); }
/** * Returns an {@code ImmutableList} containing all of the elements from this fluent iterable in * proper sequence. * * <p><b>{@code Stream} equivalent:</b> pass {@link ImmutableList#toImmutableList} to {@code * stream.collect()}. * * @throws NullPointerException if any element is {@code null} * @since 14.0 (since 12.0 as {@code toImmutableList()}). */ public final ImmutableList<E> toList() { return ImmutableList.copyOf(getDelegate()); }
/** * Returns an immutable list of paths to the files contained in the given directory. * * @throws NoSuchFileException if the file does not exist <i>(optional specific exception)</i> * @throws NotDirectoryException if the file could not be opened because it is not a directory * <i>(optional specific exception)</i> * @throws IOException if an I/O error occurs */ public static ImmutableList<Path> listFiles(Path dir) throws IOException { try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) { return ImmutableList.copyOf(stream); } catch (DirectoryIteratorException e) { throw e.getCause(); } }
@Override public ImmutableList<String> readLines() { return ImmutableList.copyOf(linesIterator()); }
TypeVariableImpl(D genericDeclaration, String name, Type[] bounds) { disallowPrimitiveType(bounds, "bound for type variable"); this.genericDeclaration = checkNotNull(genericDeclaration); this.name = checkNotNull(name); this.bounds = ImmutableList.copyOf(bounds); }
@Override protected List<E> computeNext() { if (nextPermutation == null) { return endOfData(); } ImmutableList<E> next = ImmutableList.copyOf(nextPermutation); calculateNextPermutation(); return next; }
@Override protected List<E> computeNext() { if (j <= 0) { return endOfData(); } ImmutableList<E> next = ImmutableList.copyOf(list); calculateNextPermutation(); return next; }
static <E> List<List<E>> create(List<? extends List<? extends E>> lists) { ImmutableList.Builder<List<E>> axesBuilder = new ImmutableList.Builder<List<E>>(lists.size()); for (List<? extends E> list : lists) { List<E> copy = ImmutableList.copyOf(list); if (copy.isEmpty()) { return ImmutableList.of(); } axesBuilder.add(copy); } return new CartesianList<E>(axesBuilder.build()); }