writeMapAsArrayOfPairs

fun <Key, Value> writeMapAsArrayOfPairs(map: Map<Key, Value>, pairTransformer: (Key, Value) -> Pair<JSONFriendly, JSONFriendly>)

Write a map keyed by an arbitrary type to another arbitrary type as a JSONArray of JSONArray pairs with the map keys as the first element in the JSONArray pair and the value as the second element in the JSONArray pair transformed into JSONFriendly - JSONFriendly pairs by the provided lambda.

Parameters

Key

The type of the Map's key.

Value

The type of the Map's value.

map

The Map to serialize into this JSONWriter.

pairTransformer

Accepts the map key and the associated value and answers a Pair of JSONFriendly to JSONFriendly that are written in pair order to the JSONArray pair.