Is there a standard way to convert a map to an object of a user defined class?
In Python you can do MyClass(**map) which basically unwraps the map into named arguments of the constructor of the class.
Any pointers/help would be appreciated.
Is there a standard way to convert a map to an object of a user defined class?
In Python you can do MyClass(**map) which basically unwraps the map into named arguments of the constructor of the class.
Any pointers/help would be appreciated.
There is no built-in way.
You can use one of the serialization packages like
You can use Function.apply. I made a gist to test it out the linked answer
You can also achieve this manually by using named constructor like this simple example: