Refine search
/** * Sets the elapsed time for this stopwatch to zero, and places it in a stopped state. * * @return this {@code Stopwatch} instance */ @CanIgnoreReturnValue public Stopwatch reset() { elapsedNanos = 0; isRunning = false; return this; }
/** * Implementations of {@link #computeNext} <b>must</b> invoke this method when there are no * elements left in the iteration. * * @return {@code null}; a convenience so your {@code computeNext} implementation can use the * simple statement {@code return endOfData();} */ @CanIgnoreReturnValue protected final T endOfData() { state = State.DONE; return null; }
@CanIgnoreReturnValue private static Object[] fillArray(Iterable<?> elements, Object[] array) { int i = 0; for (Object element : elements) { array[i++] = element; } return array; }
/** * Removes the edge connecting {@code nodeU} to {@code nodeV}, if it is present. * * @return the value previously associated with the edge connecting {@code nodeU} to {@code * nodeV}, or null if there was no such edge. */ @CanIgnoreReturnValue V removeEdge(N nodeU, N nodeV);
/** * Removes {@code node} if it is present; all edges incident to {@code node} will also be removed. * * @return {@code true} if the network was modified as a result of this call */ @CanIgnoreReturnValue boolean removeNode(N node);
/** * Removes {@code edge} from this network, if it is present. * * @return {@code true} if the network was modified as a result of this call */ @CanIgnoreReturnValue boolean removeEdge(E edge); }
/** * Configures the {@link ToStringHelper} so {@link #toString()} will ignore properties with null * value. The order of calling this method, relative to the {@code add()}/{@code addValue()} * methods, is not significant. * * @since 18.0 (since 12.0 as {@code Objects.ToStringHelper.omitNullValues()}). */ @CanIgnoreReturnValue public ToStringHelper omitNullValues() { omitNullValues = true; return this; }
@CanIgnoreReturnValue static int checkNonNegative(int value) { checkArgument(value >= 0, "Not true that %s is non-negative.", value); return value; }
/** * Associates all of the given map's keys and values in the built bimap. Duplicate keys or * values are not allowed, and will cause {@link #build} to fail. * * @throws NullPointerException if any key or value in {@code map} is null */ @CanIgnoreReturnValue @Override public Builder<K, V> putAll(Map<? extends K, ? extends V> map) { super.putAll(map); return this; }
/** * Associates {@code key} with {@code value} in the built map. Duplicate keys are not allowed, * and will cause {@link #build} to fail. */ @CanIgnoreReturnValue public <T extends B> Builder<B> put(Class<T> key, T value) { mapBuilder.put(key, value); return this; }
/** * Configures this builder to build {@code MinMaxPriorityQueue} instances that are limited to * {@code maximumSize} elements. Each time a queue grows beyond this bound, it immediately * removes its greatest element (according to its comparator), which might be the element that * was just added. */ @CanIgnoreReturnValue public Builder<B> maximumSize(int maximumSize) { checkArgument(maximumSize > 0); this.maximumSize = maximumSize; return this; }
/** * Specifies the ordering of the generated multimap's values for each key. * * @since 8.0 */ @CanIgnoreReturnValue public Builder<K, V> orderValuesBy(Comparator<? super V> valueComparator) { this.valueComparator = checkNotNull(valueComparator); return this; }
/** * Adds the given {@code entry} to the bimap. Duplicate keys or values are not allowed, and will * cause {@link #build} to fail. * * @since 19.0 */ @CanIgnoreReturnValue @Override public Builder<K, V> put(Entry<? extends K, ? extends V> entry) { super.put(entry); return this; }
/** * {@inheritDoc} * * @since 11.0 */ @CanIgnoreReturnValue @Override public Builder<K, V> put(Entry<? extends K, ? extends V> entry) { super.put(entry); return this; }
/** * Guaranteed to throw an exception and leave the multimap unmodified. * * @throws UnsupportedOperationException always * @deprecated Unsupported operation. */ @CanIgnoreReturnValue @Deprecated @Override public ImmutableCollection<V> removeAll(Object key) { throw new UnsupportedOperationException(); }
/** * Guaranteed to throw an exception and leave the multimap unmodified. * * @throws UnsupportedOperationException always * @deprecated Unsupported operation. */ @CanIgnoreReturnValue @Deprecated @Override public boolean putAll(K key, Iterable<? extends V> values) { throw new UnsupportedOperationException(); }
/** * Not supported. Use {@link #putInstance} instead. * * @deprecated unsupported operation * @throws UnsupportedOperationException always */ @CanIgnoreReturnValue @Deprecated @Override public B put(TypeToken<? extends B> key, B value) { throw new UnsupportedOperationException("Please use putInstance() instead."); }
/** * Guaranteed to throw an exception and leave the map unmodified. * * @throws UnsupportedOperationException always * @deprecated Unsupported operation. */ @CanIgnoreReturnValue @Deprecated @Override public final V putIfAbsent(K key, V value) { throw new UnsupportedOperationException(); }
/** * Guaranteed to throw an exception and leave the collection unmodified. * * @throws UnsupportedOperationException always * @deprecated Unsupported operation. */ @CanIgnoreReturnValue @Deprecated @Override public final boolean remove(Object object) { throw new UnsupportedOperationException(); }
/** * Appends the string representation of each of {@code parts}, using the previously configured * separator between each, to {@code appendable}. */ @CanIgnoreReturnValue public <A extends Appendable> A appendTo(A appendable, Iterable<?> parts) throws IOException { return appendTo(appendable, parts.iterator()); }