- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 16 for getIfPresent (0.1 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/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) -
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) -
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) -
android/guava-tests/benchmark/com/google/common/base/EnumsBenchmark.java
} // Since we can't pass a concrete SomeEnum.class directly, we need to use a raw type. @SuppressWarnings("unchecked") @Benchmark boolean getIfPresent(int repetitions) { boolean retVal = false; for (int i = 0; i < repetitions; ++i) { retVal &= Enums.getIfPresent(enumType, sampleData[i & 255]).isPresent(); } return retVal; } private enum SmallEnum { X0, X1, X2 }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Thu Feb 22 17:15:24 UTC 2024 - 29.4K bytes - Viewed (0) -
guava-gwt/src-super/com/google/common/cache/super/com/google/common/cache/LocalCache.java
return newValue; } catch (Exception e) { throw new ExecutionException(e); } } @Override public @Nullable V getIfPresent(Object key) { return localCache.getIfPresent(key); } @Override public void put(K key, V value) { localCache.put(key, value); } @Override public void invalidate(Object key) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Feb 27 19:19:19 UTC 2024 - 21.6K bytes - Viewed (0) -
android/guava/src/com/google/common/cache/CacheStats.java
* as a result of a refresh or if the cache loader returned more items than was requested. {@code * missCount} may also be incremented not in conjunction with this (nor {@link * #loadExceptionCount}) on calls to {@code getIfPresent}. */ public long loadSuccessCount() { return loadSuccessCount; } /** * Returns the number of times {@link Cache} lookup methods threw an exception while loading a new
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 19:07:49 UTC 2024 - 12.6K bytes - Viewed (0)