- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 24 for getIfPresent (0.07 sec)
-
guava-tests/test/com/google/common/base/EnumsTest.java
public void testGetIfPresent() { assertThat(Enums.getIfPresent(TestEnum.class, "CHEETO")).hasValue(TestEnum.CHEETO); assertThat(Enums.getIfPresent(TestEnum.class, "HONDA")).hasValue(TestEnum.HONDA); assertThat(Enums.getIfPresent(TestEnum.class, "POODLE")).hasValue(TestEnum.POODLE); assertThat(Enums.getIfPresent(TestEnum.class, "CHEETO")).isPresent(); assertThat(Enums.getIfPresent(TestEnum.class, "HONDA")).isPresent();
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed May 29 16:29:37 UTC 2024 - 8.7K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/cache/AbstractLoadingCacheTest.java
if (v == null) { throw new ExecutionException(cause); } return v; } @Override public @Nullable Object getIfPresent(Object key) { return valueRef.get(); } }; UncheckedExecutionException expected = assertThrows(UncheckedExecutionException.class, () -> cache.getUnchecked(new Object()));
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Sep 06 17:04:31 UTC 2023 - 5K bytes - Viewed (0) -
guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java
assertEquals(Integer.valueOf(100), cache.getIfPresent(10)); assertEquals(Integer.valueOf(200), cache.getIfPresent(20)); assertEquals(Integer.valueOf(2), cache.getIfPresent(4)); fakeTicker.advance(2, MILLISECONDS); assertEquals(null, cache.getIfPresent(10)); assertEquals(null, cache.getIfPresent(20)); assertEquals(null, cache.getIfPresent(4)); cache.put(10, 20);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 19:07:49 UTC 2024 - 14.4K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/cache/MapMakerComparisonBenchmark.java
map.get(TEST_KEY); } } @Benchmark void cacheBuilder_stats(int rep) { for (int i = 0; i < rep; i++) { cache.getIfPresent(TEST_KEY); } } @Benchmark void cacheBuilder(int rep) { for (int i = 0; i < rep; i++) { cacheNoStats.getIfPresent(TEST_KEY); } }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Aug 05 17:21:46 UTC 2022 - 1.9K bytes - Viewed (0) -
guava-tests/test/com/google/common/cache/AbstractLoadingCacheTest.java
if (v == null) { throw new ExecutionException(cause); } return v; } @Override public @Nullable Object getIfPresent(Object key) { return valueRef.get(); } }; UncheckedExecutionException expected = assertThrows(UncheckedExecutionException.class, () -> cache.getUnchecked(new Object()));
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Sep 06 17:04:31 UTC 2023 - 5K bytes - Viewed (0) -
guava-tests/test/com/google/common/cache/CacheManualTest.java
stats = cache.stats(); assertEquals(3, stats.missCount()); assertEquals(0, stats.loadSuccessCount()); assertEquals(0, stats.loadExceptionCount()); assertEquals(2, stats.hitCount()); assertSame(two, cache.asMap().get(one)); assertTrue(cache.asMap().containsKey(one)); assertTrue(cache.asMap().containsValue(two)); assertSame(one, cache.getIfPresent(two));
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 5.4K bytes - Viewed (0) -
android/guava/src/com/google/common/base/Enums.java
* user input or falling back to a default enum constant. For example, {@code * Enums.getIfPresent(Country.class, countryInput).or(Country.DEFAULT);} * * @since 12.0 */ public static <T extends Enum<T>> Optional<T> getIfPresent(Class<T> enumClass, String value) { checkNotNull(enumClass); checkNotNull(value); return Platform.getEnumIfPresent(enumClass, value);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri May 26 11:56:44 UTC 2023 - 5K bytes - Viewed (0) -
android/guava/src/com/google/common/cache/AbstractCache.java
* * <p>To implement a cache, the programmer needs only to extend this class and provide an * implementation for the {@link #put} and {@link #getIfPresent} methods. {@link #getAllPresent} is * implemented in terms of {@link #getIfPresent}; {@link #putAll} is implemented in terms of {@link * #put}, {@link #invalidateAll(Iterable)} is implemented in terms of {@link #invalidate}. The
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Jun 15 18:00:07 UTC 2021 - 9.1K bytes - Viewed (0) -
guava/src/com/google/common/base/Enums.java
* user input or falling back to a default enum constant. For example, {@code * Enums.getIfPresent(Country.class, countryInput).or(Country.DEFAULT);} * * @since 12.0 */ public static <T extends Enum<T>> Optional<T> getIfPresent(Class<T> enumClass, String value) { checkNotNull(enumClass); checkNotNull(value); return Platform.getEnumIfPresent(enumClass, value);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri May 26 11:56:44 UTC 2023 - 5K bytes - Viewed (0) -
src/main/java/org/codelibs/fess/helper/CrawlerStatsHelper.java
} public void record(final Object keyObj, final String action) { getCacheKey(keyObj).ifPresent(key -> { try { final StatsObject data = statsCache.getIfPresent(key); if (data != null) { data.put(escapeValue(action), getCurrentTimeMillis()); } } catch (final Exception e) {
Registered: Thu Oct 31 13:40:30 UTC 2024 - Last Modified: Thu Feb 22 01:53:18 UTC 2024 - 9.9K bytes - Viewed (0)