Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 21 for getIfPresent (0.07 sec)

  1. 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 Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Dec 19 18:03:30 UTC 2024
    - 29.4K bytes
    - Viewed (0)
  2. 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 Dec 26 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 21.8K bytes
    - Viewed (0)
  3. 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 Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Jul 08 18:32:10 UTC 2025
    - 12.6K bytes
    - Viewed (0)
  4. 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 Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Jul 08 18:32:10 UTC 2025
    - 12.6K bytes
    - Viewed (0)
  5. 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);
        }
      }
    
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Sep 30 22:03:28 UTC 2025
    - 15.7K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/cache/Cache.java

       * cached value for {@code key}.
       *
       * @since 11.0
       */
      @CanIgnoreReturnValue // TODO(b/27479612): consider removing this?
      @Nullable V getIfPresent(@CompatibleWith("K") Object key);
    
      /**
       * Returns the value associated with {@code key} in this cache, obtaining that value from {@code
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Sun Dec 22 03:38:46 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  7. 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);
        }
      }
    
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Sep 30 22:03:28 UTC 2025
    - 15.7K bytes
    - Viewed (0)
  8. 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);
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Sep 30 22:03:28 UTC 2025
    - 91.1K bytes
    - Viewed (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);
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Sep 30 22:03:28 UTC 2025
    - 91.1K bytes
    - Viewed (0)
  10. 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(
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Sep 11 19:35:11 UTC 2025
    - 148.9K bytes
    - Viewed (0)
Back to top