Here is my Java code which is used for the de-serialization, i am trying to convert json string into java object. In doing so i have used the following code:
You have to change the line
product userFromJSON = mapper.readValue(userDataJSON, product.class);
to
product[] userFromJSON = mapper.readValue(userDataJSON, product[].class);
since you are deserializing an array (btw: you should start your class names with upper case letters as mentioned earlier). Additionally you have to create setter methods for your fields or mark them as public in order to make this work.
Edit: You can also go with Steven Schlansker's suggestion and use
List userFromJSON =
mapper.readValue(userDataJSON, new TypeReference>() {});
instead if you want to avoid arrays.