0

I am trying to fiddle with ObjectMapper's properties to achieve the following, but did dot find a way till now

Context : We've following classes

class X {
     :
}

class C {
    private String c1;
    private String c2;
    private List<X> c3;
}

Input : A String that represents JSONArray. Ex : "[ {..}, {..} ]"
Output : Java Class 'C' with c1, c2 set as null and c3 set from input

I do not want to transform input to JSON string first and then create an instance of C myself and then set c3 manually. Can I deserialize input JSON string as described above?

Ihor Patsian
  • 1,288
  • 2
  • 15
  • 25
DanglingPointer
  • 261
  • 1
  • 6
  • 19

0 Answers0