MCPcopy Create free account
hub / github.com/antlr/codebuff / unmodifiableEntry

Method unmodifiableEntry

output/java_guava/1.4.17/Maps.java:1351–1364  ·  view source on GitHub ↗

Returns an unmodifiable view of the specified map entry. The Entry#setValue operation throws an UnsupportedOperationException. This also has the side-effect of redefining equals to comply with the Entry contract, to avoid a possible nefarious implementation of equals. @param

(final Entry<? extends K, ? extends V> entry)

Source from the content-addressed store, hash-verified

1349
1350
1351 static <K, V> Entry<K, V> unmodifiableEntry(final Entry<? extends K, ? extends V> entry) {
1352 checkNotNull(entry);
1353 return new AbstractMapEntry<K, V>() {
1354 @Override
1355 public K getKey() {
1356 return entry.getKey();
1357 }
1358
1359 @Override
1360 public V getValue() {
1361 return entry.getValue();
1362 }
1363 };
1364 }
1365
1366
1367 static <K, V> UnmodifiableIterator<Entry<K, V>> unmodifiableEntryIterator(final Iterator<Entry<K, V>> entryIterator) {

Callers 4

nextMethod · 0.95
unmodifiableOrNullMethod · 0.95
containsEntryImplMethod · 0.95
removeEntryImplMethod · 0.95

Calls 1

checkNotNullMethod · 0.45

Tested by

no test coverage detected