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

Method computeIfAbsent

guava/src/com/google/common/cache/LocalCache.java:4233–4238  ·  view source on GitHub ↗
(K key, Function<? super K, ? extends V> function)

Source from the content-addressed store, hash-verified

4231 }
4232
4233 @Override
4234 public V computeIfAbsent(K key, Function<? super K, ? extends V> function) {
4235 checkNotNull(key);
4236 checkNotNull(function);
4237 return compute(key, (k, oldValue) -> (oldValue == null) ? function.apply(key) : oldValue);
4238 }
4239
4240 @Override
4241 public @Nullable V computeIfPresent(

Calls 3

computeMethod · 0.95
applyMethod · 0.65
checkNotNullMethod · 0.45