- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 16 for getOnlyElement (0.12 sec)
-
android/guava-tests/test/com/google/common/collect/IterablesTest.java
} public void testGetOnlyElement_withDefault_singleton() { Iterable<String> iterable = singletonList("foo"); assertEquals("foo", getOnlyElement(iterable, "bar")); } public void testGetOnlyElement_withDefault_empty() { Iterable<String> iterable = emptyList(); assertEquals("bar", getOnlyElement(iterable, "bar")); }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 45.2K bytes - Viewed (0) -
guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableMap.java
import static com.google.common.base.Preconditions.checkState; import static com.google.common.collect.CollectPreconditions.checkEntryNotNull; import static com.google.common.collect.Iterables.getOnlyElement; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.io.Serializable; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.EnumMap;
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Wed Aug 06 18:32:41 UTC 2025 - 16.7K bytes - Viewed (0) -
android/guava/src/com/google/common/collect/Iterables.java
* @throws IllegalArgumentException if the iterable contains multiple elements */ @ParametricNullness public static <T extends @Nullable Object> T getOnlyElement(Iterable<T> iterable) { return Iterators.getOnlyElement(iterable.iterator()); } /** * Returns the single element contained in {@code iterable}, or {@code defaultValue} if the * iterable is empty. *
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 43.6K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java
List<Future<String>> results; results = service.invokeAll(callables); assertThat(getOnlyElement(results)).isInstanceOf(TrustedListenableFutureTask.class); results = service.invokeAll(callables, 1, SECONDS); assertThat(getOnlyElement(results)).isInstanceOf(TrustedListenableFutureTask.class); /* * TODO(cpovirk): move ForwardingTestCase somewhere common, and use it to
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Tue May 13 18:46:00 UTC 2025 - 28K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/IterablesTest.java
} public void testGetOnlyElement_withDefault_singleton() { Iterable<String> iterable = singletonList("foo"); assertEquals("foo", getOnlyElement(iterable, "bar")); } public void testGetOnlyElement_withDefault_empty() { Iterable<String> iterable = emptyList(); assertEquals("bar", getOnlyElement(iterable, "bar")); }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 46.6K bytes - Viewed (0) -
android/guava/src/com/google/common/collect/ImmutableTable.java
* limitations under the License. */ package com.google.common.collect; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.collect.Iterables.getOnlyElement; import static com.google.common.collect.Tables.immutableCell; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible;
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Tue May 13 17:27:14 UTC 2025 - 17.4K bytes - Viewed (0) -
guava/src/com/google/common/collect/Iterables.java
* @throws IllegalArgumentException if the iterable contains multiple elements */ @ParametricNullness public static <T extends @Nullable Object> T getOnlyElement(Iterable<T> iterable) { return Iterators.getOnlyElement(iterable.iterator()); } /** * Returns the single element contained in {@code iterable}, or {@code defaultValue} if the * iterable is empty. *
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 43.3K bytes - Viewed (0) -
guava/src/com/google/common/collect/ImmutableTable.java
* limitations under the License. */ package com.google.common.collect; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.collect.Iterables.getOnlyElement; import static com.google.common.collect.Tables.immutableCell; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible;
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Tue May 13 17:27:14 UTC 2025 - 17.3K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java
} } public void testWriteThroughEntry() { for (LoadingCache<Object, Object> cache : caches()) { cache.getUnchecked(1); Entry<Object, Object> entry = Iterables.getOnlyElement(cache.asMap().entrySet()); cache.invalidate(1); assertEquals(0, cache.size()); entry.setValue(3); assertEquals(1, cache.size()); assertEquals(3, cache.getIfPresent(1));
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Tue May 13 17:27:14 UTC 2025 - 15.1K bytes - Viewed (0) -
guava-tests/test/com/google/common/base/ThrowablesTest.java
IllegalStateException ex = new IllegalStateException(re); assertThat(getCausalChain(ex)).containsExactly(ex, re, iae, sue).inOrder(); assertSame(sue, Iterables.getOnlyElement(getCausalChain(sue))); List<Throwable> causes = getCausalChain(ex); assertThrows(UnsupportedOperationException.class, () -> causes.add(new RuntimeException())); }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 14.9K bytes - Viewed (0)