How to pass a Java Map to UDF function

Hi , i am using java8 with spark-2.4.1 version, i have a scenario where i need to do look up for multiple dataset columns in the given HashMap values and replace column value with look up value from map.

For the same I need to write and UDF2 function
i.e. inputs of UDF is Map<Integer,Integer> , Integer …which returns Integer… so how to pass a map paramenter into UDF ?

thanks,
Shyam
9949828125