Specifies the maximum weight of entries the cache may contain. Weight is determined using the Weigher specified with #weigher, and use of this method requires a corresponding call to #weigher prior to calling #build. Note that the cache may evict an entry befor
(long weight)
| 451 | */ |
| 452 | |
| 453 | @GwtIncompatible // To be supported |
| 454 | public CacheBuilder<K, V> maximumWeight(long weight) { |
| 455 | checkState(this.maximumWeight == UNSET_INT, "maximum weight was already set to %s", this.maximumWeight); |
| 456 | checkState(this.maximumSize == UNSET_INT, "maximum size was already set to %s", this.maximumSize); |
| 457 | this.maximumWeight = weight; |
| 458 | checkArgument(weight >= 0, "maximum weight must not be negative"); |
| 459 | return this; |
| 460 | } |
| 461 | |
| 462 | /** |
| 463 | * Specifies the weigher to use in determining the weight of entries. Entry weight is taken into |
no test coverage detected