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

Method getIfPresent

guava/src/com/google/common/cache/LocalCache.java:3988–3997  ·  view source on GitHub ↗
(Object key)

Source from the content-addressed store, hash-verified

3986 }
3987
3988 @Nullable V getIfPresent(Object key) {
3989 int hash = hash(checkNotNull(key));
3990 V value = segmentFor(hash).get(key, hash);
3991 if (value == null) {
3992 globalStatsCounter.recordMisses(1);
3993 } else {
3994 globalStatsCounter.recordHits(1);
3995 }
3996 return value;
3997 }
3998
3999 @Override
4000 public @Nullable V getOrDefault(@Nullable Object key, @Nullable V defaultValue) {

Callers

nothing calls this directly

Calls 6

hashMethod · 0.95
segmentForMethod · 0.95
getMethod · 0.65
recordMissesMethod · 0.65
recordHitsMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected