Class BoundedWeigher<K,V>

java.lang.Object
com.github.benmanes.caffeine.cache.BoundedWeigher<K,V>
All Implemented Interfaces:
Weigher<K,V>, Serializable

final class BoundedWeigher<K,V> extends Object implements Weigher<K,V>, Serializable
  • Field Details

  • Constructor Details

    • BoundedWeigher

      BoundedWeigher(Weigher<? super K,? super V> delegate)
  • Method Details

    • weigh

      public int weigh(K key, V value)
      Description copied from interface: Weigher
      Returns the weight of a cache entry. There is no unit for entry weights; rather they are simply relative to each other.
      Specified by:
      weigh in interface Weigher<K,V>
      Parameters:
      key - the key to weigh
      value - the value to weigh
      Returns:
      the weight of the entry; must be non-negative
    • writeReplace

      Object writeReplace()