MCPcopy
hub / github.com/google/guava / build

Method build

guava/src/com/google/common/cache/CacheBuilder.java:1037–1041  ·  view source on GitHub ↗

Builds a cache, which either returns an already-loaded value for a given key or atomically computes or retrieves it using the supplied {@code CacheLoader}. If another thread is currently loading the value for this key, simply waits for that thread to finish and returns its loaded value. Note that mu

(
      CacheLoader<? super K1, V1> loader)

Source from the content-addressed store, hash-verified

1035 * @return a cache having the requested features
1036 */
1037 public <K1 extends K, V1 extends V> LoadingCache<K1, V1> build(
1038 CacheLoader<? super K1, V1> loader) {
1039 checkWeightWithWeigher();
1040 return new LocalCache.LocalLoadingCache<>(this, loader);
1041 }
1042
1043 /**
1044 * Builds a cache which does not automatically load values when keys are requested.

Callers 8

readObjectMethod · 0.45
readObjectMethod · 0.45
userPermissionsMethod · 0.45
HtmlEscapersClass · 0.45
XmlEscapersClass · 0.45
withParametersMethod · 0.45
createMethod · 0.45
parseMethod · 0.45

Calls 2

checkNonLoadingCacheMethod · 0.95

Tested by

no test coverage detected