Closed
Description
Refering to Stack-Overflow
The situation is: I have a REST service that must be called with a huge amount of parameters (as by customer request) and those should be stored in a database. The easiest way to do that would be to take the parameter map and map that to an entity object. As it is about the same type of code to map from an object to and object or from a map to an object I assume it should not be too difficult to allow mapping like this:
public MyEntity mapToEntity(final Map<String, String> parameters);
Essentially that should turn into code like this:
myEntity.setName( parameters.get("name") );
myEntity.setReferrer( stringToReferrer( parameters.get("referrer") ) );
//...
It would be nice to have other variable types supported as well, like Map<String, Object>, but I am not sure at which point it becomes too complicated.