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

Method containsEntryImpl

guava/src/com/google/common/collect/Maps.java:3819–3825  ·  view source on GitHub ↗

Implements {@code Collection.contains} safely for forwarding collections of map entries. If {@code o} is an instance of {@code Entry}, it is wrapped using {@link #unmodifiableEntry} to protect against a possible nefarious equals method. <p>Note that {@code c} is the backing (delegate) collection, r

(
      Collection<Entry<K, V>> c, @Nullable Object o)

Source from the content-addressed store, hash-verified

3817 * @return {@code true} if {@code c} contains {@code o}
3818 */
3819 static <K extends @Nullable Object, V extends @Nullable Object> boolean containsEntryImpl(
3820 Collection<Entry<K, V>> c, @Nullable Object o) {
3821 if (!(o instanceof Entry)) {
3822 return false;
3823 }
3824 return c.contains(unmodifiableEntry((Entry<?, ?>) o));
3825 }
3826
3827 /**
3828 * Implements {@code Collection.remove} safely for forwarding collections of map entries. If

Callers 2

containsMethod · 0.95
containsMethod · 0.95

Calls 2

unmodifiableEntryMethod · 0.95
containsMethod · 0.65

Tested by

no test coverage detected