Lines Matching defs:weigher
207 Weigher<? super K, ? super V> weigher;
347 checkState(this.weigher == null, "maximum size can not be combined with weigher");
355 * {@link Weigher} specified with {@link #weigher}, and use of this method requires a
356 * corresponding call to {@link #weigher} prior to calling {@link #build}.
383 * Specifies the weigher to use in determining the weight of entries. Entry weight is taken
397 * weigher already provided; the {@code CacheBuilder} type cannot do this. For best results,
402 * a cache whose key or value type is incompatible with the weigher, you will likely experience
405 * @param weigher the weigher to use in calculating the weight of cache entries
410 public <K1 extends K, V1 extends V> CacheBuilder<K1, V1> weigher(
411 Weigher<? super K1, ? super V1> weigher) {
412 checkState(this.weigher == null);
414 checkState(this.maximumSize == UNSET_INT, "weigher can not be combined with maximum size",
421 me.weigher = checkNotNull(weigher);
429 return (weigher == null) ? maximumSize : maximumWeight;
435 return (Weigher<K1, V1>) Objects.firstNonNull(weigher, OneWeigher.INSTANCE);
765 if (weigher == null) {
766 checkState(maximumWeight == UNSET_INT, "maximumWeight requires weigher");
769 checkState(maximumWeight != UNSET_INT, "weigher requires maximumWeight");
772 logger.log(Level.WARNING, "ignoring weigher specified without maximumWeight");
792 if (weigher == null) {