Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 31 for getIfPresent (0.34 seconds)

  1. android/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();
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Fri Mar 13 01:05:11 GMT 2026
    - 8.4K bytes
    - Click Count (0)
  2. 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);
        }
      }
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Dec 19 18:03:30 GMT 2024
    - 2K bytes
    - Click Count (0)
  3. guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java

        doParallelCacheOp(count, n -> cache.asMap().computeIfPresent(key, (k, v) -> v + delimiter + n));
        assertThat(cache.size()).isEqualTo(1);
        assertThat(cache.getIfPresent(key).split(delimiter)).hasLength(count + 1);
      }
    
      public void testComputeIfPresentRemove() {
        List<RemovalNotification<Integer, Integer>> notifications = new ArrayList<>();
        Cache<Integer, Integer> cache =
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 6.4K bytes
    - Click Count (0)
  4. 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) {
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Thu Aug 07 03:06:29 GMT 2025
    - 17.4K bytes
    - Click Count (0)
  5. src/main/java/org/codelibs/fess/helper/RateLimitHelper.java

                }
                return true;
            }
    
            // Check dynamically blocked IPs (Cache handles expiration automatically)
            final Boolean blocked = blockedIps.getIfPresent(ip);
            if (blocked != null) {
                if (logger.isDebugEnabled()) {
                    logger.debug("IP dynamically blocked: ip={}", ip);
                }
                return true;
            }
    
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Wed Dec 24 14:16:27 GMT 2025
    - 9.4K bytes
    - Click Count (0)
  6. android/guava/src/com/google/common/cache/LocalCache.java

        private LocalManualCache(LocalCache<K, V> localCache) {
          this.localCache = localCache;
        }
    
        // Cache methods
    
        @Override
        public @Nullable V getIfPresent(Object key) {
          return localCache.getIfPresent(key);
        }
    
        @Override
        public V get(K key, Callable<? extends V> valueLoader) throws ExecutionException {
          checkNotNull(valueLoader);
          return localCache.get(
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Apr 01 17:27:13 GMT 2026
    - 143.5K bytes
    - Click Count (0)
  7. android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java

          cache.invalidate(1);
          assertThat(cache.size()).isEqualTo(0);
    
          entry.setValue(3);
          assertThat(cache.size()).isEqualTo(1);
          assertThat(cache.getIfPresent(1)).isEqualTo(3);
          checkValidState(cache);
    
          assertThrows(NullPointerException.class, () -> entry.setValue(null));
          checkValidState(cache);
        }
      }
    
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 15.4K bytes
    - Click Count (0)
  8. guava/src/com/google/common/cache/LocalCache.java

        private LocalManualCache(LocalCache<K, V> localCache) {
          this.localCache = localCache;
        }
    
        // Cache methods
    
        @Override
        public @Nullable V getIfPresent(Object key) {
          return localCache.getIfPresent(key);
        }
    
        @Override
        public V get(K key, Callable<? extends V> valueLoader) throws ExecutionException {
          checkNotNull(valueLoader);
          return localCache.get(
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Apr 01 17:27:13 GMT 2026
    - 148.9K bytes
    - Click Count (0)
  9. guava-tests/test/com/google/common/cache/CacheLoadingTest.java

        assertThat(cache.getIfPresent(key)).isSameInstanceAs(one);
        stats = cache.stats();
        assertThat(stats.missCount()).isEqualTo(1);
        assertThat(stats.loadSuccessCount()).isEqualTo(1);
        assertThat(stats.loadExceptionCount()).isEqualTo(0);
        assertThat(stats.hitCount()).isEqualTo(1);
    
        ticker.advance(1, MILLISECONDS);
        assertThat(cache.getIfPresent(key)).isSameInstanceAs(two);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 91K bytes
    - Click Count (0)
  10. android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java

        assertThat(cache.getIfPresent(key)).isSameInstanceAs(one);
        stats = cache.stats();
        assertThat(stats.missCount()).isEqualTo(1);
        assertThat(stats.loadSuccessCount()).isEqualTo(1);
        assertThat(stats.loadExceptionCount()).isEqualTo(0);
        assertThat(stats.hitCount()).isEqualTo(1);
    
        ticker.advance(1, MILLISECONDS);
        assertThat(cache.getIfPresent(key)).isSameInstanceAs(two);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 91K bytes
    - Click Count (0)
Back to Top