Instance Mapping
Mapping to destination classes without a no arg constructor.
Last updated
Was this helpful?
Mapping to destination classes without a no arg constructor.
Last updated
Was this helpful?
Due to the fact that ShapeShift uses reflection behind the scenes, destination classes need a no arg constructor. But in some cases you have no control over the destination classes and cannot modify them to add a no arg constructor. This is where Instance Mapping comes into play, you can pass already-instantiated destination objects to the map
method.
SimpleEntityDisplay
does not have a no arg constructor. You can either add a no arg constructor or initiate a new instance of SimpleEntityDisplay
and pass it to the map
function.