Is there any direct method to convert the HTTP request parameters to an object? (something like object mapper)
For example, if the request http://localhot:8080/users/id=5&name=10 httpHandler() then id=5&name=10 this needs to converted to User object
public class User {
int id;
String name;
//getters and setters
}
class MyHandler implements HttpHandler {
@Override
public void Handle(HttpExchange http) {
String param = http.get.getRequestURI().getQuery();
?? // how to map it to the User Object?
}
}