Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for getIfPresent (0.07 sec)

  1. 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)
  2. 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)
  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 Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 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 Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java

          cache.invalidate(1);
          assertEquals(0, cache.size());
    
          entry.setValue(3);
          assertEquals(1, cache.size());
          assertEquals(3, cache.getIfPresent(1));
          checkValidState(cache);
    
          assertThrows(NullPointerException.class, () -> entry.setValue(null));
          checkValidState(cache);
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 02 18:21:29 UTC 2024
    - 15K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/cache/PopulatedCachesTest.java

          cache.invalidate(1);
          assertEquals(0, cache.size());
    
          entry.setValue(3);
          assertEquals(1, cache.size());
          assertEquals(3, cache.getIfPresent(1));
          checkValidState(cache);
    
          assertThrows(NullPointerException.class, () -> entry.setValue(null));
          checkValidState(cache);
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 02 18:21:29 UTC 2024
    - 15K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java

        ticker.advance(1, MILLISECONDS);
        assertSame(one, cache.getIfPresent(key));
        stats = cache.stats();
        assertEquals(1, stats.missCount());
        assertEquals(1, stats.loadSuccessCount());
        assertEquals(0, stats.loadExceptionCount());
        assertEquals(1, stats.hitCount());
    
        ticker.advance(1, MILLISECONDS);
        assertSame(two, cache.getIfPresent(key));
        stats = cache.stats();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 86.3K bytes
    - Viewed (0)
  8. guava/src/com/google/common/cache/LocalCache.java

          this.localCache = localCache;
        }
    
        // Cache methods
    
        @Override
        @CheckForNull
        public V getIfPresent(Object key) {
          return localCache.getIfPresent(key);
        }
    
        @Override
        public V get(K key, final Callable<? extends V> valueLoader) throws ExecutionException {
          checkNotNull(valueLoader);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 149.2K bytes
    - Viewed (0)
Back to top