/** * Creates a new {@code RemovalNotification} for the given {@code key}/{@code value} pair, with * the given {@code cause} for the removal. The {@code key} and/or {@code value} may be {@code * null} if they were already garbage collected. * * @since 19.0 */ public static <K, V> RemovalNotification<K, V> create( @Nullable K key, @Nullable V value, RemovalCause cause) { return new RemovalNotification(key, value, cause); }
/** * Creates a new {@code RemovalNotification} for the given {@code key}/{@code value} pair, with * the given {@code cause} for the removal. The {@code key} and/or {@code value} may be {@code * null} if they were already garbage collected. * * @since 19.0 */ public static <K, V> RemovalNotification<K, V> create( @NullableDecl K key, @NullableDecl V value, RemovalCause cause) { return new RemovalNotification(key, value, cause); }
/** * Creates a new {@code RemovalNotification} for the given {@code key}/{@code value} pair, with * the given {@code cause} for the removal. The {@code key} and/or {@code value} may be {@code * null} if they were already garbage collected. * * @since 19.0 */ public static <K, V> RemovalNotification<K, V> create( @NullableDecl K key, @NullableDecl V value, RemovalCause cause) { return new RemovalNotification(key, value, cause); }
/** * Creates a new {@code RemovalNotification} for the given {@code key}/{@code value} pair, with * the given {@code cause} for the removal. The {@code key} and/or {@code value} may be * {@code null} if they were already garbage collected. * * @since 19.0 */ public static <K, V> RemovalNotification<K, V> create( @Nullable K key, @Nullable V value, RemovalCause cause) { return new RemovalNotification(key, value, cause); }
/** * Creates a new {@code RemovalNotification} for the given {@code key}/{@code value} pair, with * the given {@code cause} for the removal. The {@code key} and/or {@code value} may be {@code * null} if they were already garbage collected. * * @since 19.0 */ public static <K, V> RemovalNotification<K, V> create( @Nullable K key, @Nullable V value, RemovalCause cause) { return new RemovalNotification(key, value, cause); }
/** * Creates a new {@code RemovalNotification} for the given {@code key}/{@code value} pair, with * the given {@code cause} for the removal. The {@code key} and/or {@code value} may be {@code * null} if they were already garbage collected. * * @since 19.0 */ public static <K, V> RemovalNotification<K, V> create( @NullableDecl K key, @NullableDecl V value, RemovalCause cause) { return new RemovalNotification(key, value, cause); }
@GuardedBy("Segment.this") void enqueueNotification(@Nullable K key, int hash, ValueReference<K, V> valueReference, RemovalCause cause) { totalWeight -= valueReference.getWeight(); if (cause.wasEvicted()) { statsCounter.recordEviction(); } if (map.removalNotificationQueue != DISCARDING_QUEUE) { V value = valueReference.get(); RemovalNotification<K, V> notification = new RemovalNotification<K, V>(key, value, cause); map.removalNotificationQueue.offer(notification); } }
@GuardedBy("Segment.this") void enqueueNotification(@Nullable K key, int hash, ValueReference<K, V> valueReference, RemovalCause cause) { totalWeight -= valueReference.getWeight(); if (cause.wasEvicted()) { statsCounter.recordEviction(); } if (map.removalNotificationQueue != DISCARDING_QUEUE) { V value = valueReference.get(); RemovalNotification<K, V> notification = new RemovalNotification<K, V>(key, value, cause); map.removalNotificationQueue.offer(notification); } }
@GuardedBy("Segment.this") void enqueueNotification(@Nullable K key, int hash, ValueReference<K, V> valueReference, RemovalCause cause) { totalWeight -= valueReference.getWeight(); if (cause.wasEvicted()) { statsCounter.recordEviction(); } if (map.removalNotificationQueue != DISCARDING_QUEUE) { V value = valueReference.get(); RemovalNotification<K, V> notification = new RemovalNotification<K, V>(key, value, cause); map.removalNotificationQueue.offer(notification); } }
@GuardedBy("Segment.this") void enqueueNotification(@Nullable K key, int hash, ValueReference<K, V> valueReference, RemovalCause cause) { totalWeight -= valueReference.getWeight(); if (cause.wasEvicted()) { statsCounter.recordEviction(); } if (map.removalNotificationQueue != DISCARDING_QUEUE) { V value = valueReference.get(); RemovalNotification<K, V> notification = new RemovalNotification<K, V>(key, value, cause); map.removalNotificationQueue.offer(notification); } }
@GuardedBy("Segment.this") void enqueueNotification(@Nullable K key, int hash, ValueReference<K, V> valueReference, RemovalCause cause) { totalWeight -= valueReference.getWeight(); if (cause.wasEvicted()) { statsCounter.recordEviction(); } if (map.removalNotificationQueue != DISCARDING_QUEUE) { V value = valueReference.get(); RemovalNotification<K, V> notification = new RemovalNotification<K, V>(key, value, cause); map.removalNotificationQueue.offer(notification); } }
@GuardedBy("Segment.this") void enqueueNotification(@Nullable K key, int hash, ValueReference<K, V> valueReference, RemovalCause cause) { totalWeight -= valueReference.getWeight(); if (cause.wasEvicted()) { statsCounter.recordEviction(); } if (map.removalNotificationQueue != DISCARDING_QUEUE) { V value = valueReference.get(); RemovalNotification<K, V> notification = new RemovalNotification<K, V>(key, value, cause); map.removalNotificationQueue.offer(notification); } }
@GuardedBy("Segment.this") void enqueueNotification(@Nullable K key, int hash, ValueReference<K, V> valueReference, RemovalCause cause) { totalWeight -= valueReference.getWeight(); if (cause.wasEvicted()) { statsCounter.recordEviction(); } if (map.removalNotificationQueue != DISCARDING_QUEUE) { V value = valueReference.get(); RemovalNotification<K, V> notification = new RemovalNotification<K, V>(key, value, cause); map.removalNotificationQueue.offer(notification); } }
@GuardedBy("Segment.this") void enqueueNotification(@Nullable K key, int hash, ValueReference<K, V> valueReference, RemovalCause cause) { totalWeight -= valueReference.getWeight(); if (cause.wasEvicted()) { statsCounter.recordEviction(); } if (map.removalNotificationQueue != DISCARDING_QUEUE) { V value = valueReference.get(); RemovalNotification<K, V> notification = new RemovalNotification<K, V>(key, value, cause); map.removalNotificationQueue.offer(notification); } }