How to parse nested JSON input to object into jersey?

I am passing input to my API like this:

  "param1": "value1",
  "param3": {
               "min": "xyz",
               "max": "abc"

I want to parse this JSON request into object like :

class Filter {
       String param1;
       String param2;
       //frequency object will consist of maximum and minimum attributes
       Frequency frequency


How it is possible to automatically instantiate filter object in my API method?

Thanks in advance.


You can use jackson mapper


or if You using Jersey instead


ObjectMapper mapper = new ObjectMapper();
String jsonString = "{\"param1\":\"Bar\",\"param2\":\"Foo\",\"frequency\":{\"min\":0,\"max\":10}}";
Filter filter = mapper.readValue(jsonString, Filter.class);

public class Filter {
    public String param1;
    public String param2;
    public Frequency frequency;

public class Frequency {
    public int min;
    public int max;

Need Your Help

List global variables in executable

c xcode macos gcc otool

How can I dump all the global variables and the address offsets in my executable?

Can I use redux-saga's es6 generators as onmessage listener for websockets or eventsource?

reactjs ecmascript-6 redux redux-saga

I'm trying to get redux-saga working with the onmessage listener. I don't know why what I have isn't working.