Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 4 of 4 for RemovalListener (0.07 seconds)

  1. guava-tests/test/com/google/common/cache/LocalCacheTest.java

      public void testComputeIfAbsent_removalListener() {
        List<RemovalNotification<Object, Object>> notifications = new ArrayList<>();
        RemovalListener<Object, Object> removalListener = notifications::add;
        Cache<Object, Object> cache =
            CacheBuilder.newBuilder().removalListener(removalListener).build();
        cache.put("a", "b");
        cache.asMap().computeIfAbsent("a", k -> "c");
        assertThat(notifications).isEmpty();
      }
    
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 116.4K bytes
    - Click Count (0)
  2. android/guava-tests/test/com/google/common/cache/LocalCacheTest.java

          refreshExecutor.shutdown();
        }
      }
    
      public void testSetRemovalListener() {
        RemovalListener<Object, Object> testListener = TestingRemovalListeners.nullRemovalListener();
        LocalCache<Object, Object> map =
            makeLocalCache(createCacheBuilder().removalListener(testListener));
        assertThat(map.removalListener).isSameInstanceAs(testListener);
      }
    
      public void testSetTicker() {
        Ticker testTicker =
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 114.9K bytes
    - Click Count (0)
  3. android/guava/src/com/google/common/cache/LocalCache.java

      /**
       * A listener that is invoked when an entry is removed due to expiration or garbage collection of
       * soft/weak entries.
       */
      final RemovalListener<K, V> removalListener;
    
      /** Measures time in a testable way. */
      final Ticker ticker;
    
      /** Factory used to create new entries. */
      final EntryFactory entryFactory;
    
      /**
    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)
  4. guava/src/com/google/common/cache/LocalCache.java

      /**
       * A listener that is invoked when an entry is removed due to expiration or garbage collection of
       * soft/weak entries.
       */
      final RemovalListener<K, V> removalListener;
    
      /** Measures time in a testable way. */
      final Ticker ticker;
    
      /** Factory used to create new entries. */
      final EntryFactory entryFactory;
    
      /**
    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)
Back to Top