toMap

Convert input to a map< K, V >.

Parameters:

No. Type Comments
1 list< T > or set< T > of tuple< :T1, :T2, .. > with 2 values Input to convert to a map
2 Lambda expression to extract key If arg 1 is a list or set. Type of return value become map key type
3 Lambda expression to extract value If arg 1 is a list or set. Type of return value become map value type

Returns:

map<K,V> - Value as a map.

Usages:

  • toMap( v:list< tuple<K, V> > ) : map<K,V>
  • toMap( v:list< T >, e => toInt(e), e => toString(e) ) : map<K,V>