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

Method toMap

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

Returns an immutable map whose keys are the distinct elements of {@code keys} and whose value for each key was computed by {@code valueFunction}. The map's iteration order is the order of the first appearance of each key in {@code keys}. <p>When there are multiple instances of a key in {@code keys}

(
      Iterable<K> keys, Function<? super K, V> valueFunction)

Source from the content-addressed store, hash-verified

1253 * @since 14.0
1254 */
1255 public static <K, V> ImmutableMap<K, V> toMap(
1256 Iterable<K> keys, Function<? super K, V> valueFunction) {
1257 return toMap(keys.iterator(), valueFunction);
1258 }
1259
1260 /**
1261 * Returns an immutable map whose keys are the distinct elements of {@code keys} and whose value

Callers 12

toMapMethod · 0.95
testToMapMethod · 0.95
testToMapIteratorMethod · 0.95
testToMapWithNullKeysMethod · 0.95
toImmutableMapMethod · 0.45
toImmutableSortedMapMethod · 0.45
testToMapMethod · 0.45
testToMap_nullKeyMethod · 0.45
testToMap_nullValueMethod · 0.45
toImmutableMapMethod · 0.45

Calls 8

builderMethod · 0.95
iteratorMethod · 0.65
nextMethod · 0.65
putMethod · 0.65
applyMethod · 0.65
checkNotNullMethod · 0.45
hasNextMethod · 0.45
buildKeepingLastMethod · 0.45

Tested by 8

testToMapMethod · 0.76
testToMapIteratorMethod · 0.76
testToMapWithNullKeysMethod · 0.76
testToMapMethod · 0.36
testToMap_nullKeyMethod · 0.36
testToMap_nullValueMethod · 0.36