Does anyone know how to retrieve the value by label/key from the map? i.e. map.getEntry(String key). The closest I can find is map.getEntries(int index) but I don’t want to search the whole map. Thanks.
ValueOuterClass.Map is the serialized representation of you Daml map in protobuf. From java point of view, you should better see this data structure as an association list, in other words you will need to either convert this list yourself into a Hash/TreeMap or directly search inside.
Note that the ledger API guarantees you the association has no duplicate and is sorted by key (be careful Daml assumes UTF8 ordering).
The reason why we are not using protobuf generic map, is we want to enforce ordering on the wire while generic maps do not allow us to do that.