A Map maps something to something else.
I like to use names like uidToPerson
. “To” being the shortest unambiguous way I can think of to show that I have a map.
Edit:
I’ll add that I prefer to have the map named this way, because “key” and “value” appear in that order in the name. As opposed to valueByKey
. In mapping operations, the key comes first. You put(key, value)
or get(key)
that gives a value.
Of course this is a matter of personal preference.