How to use the POJO class that is already been provided to us?

I managed to read the TODO’s and now i am declaring a ObjectMapper using the methods provided. I am not sure how to use the POJO here.

Is it like below?
PortfolioTrade.java emp = objectMapper.readValue(file, PortfolioTrade.class);

Hey You can refer to the following FAQ:
https://forum.crio.do/t/what-is-json-and-how-to-iterate-through-the-json-object/7178/2
Hope this solved your issue :slight_smile:

Yeah you are on the right track. Just search on google how to create a list of objects of a class because the file has a list of json objects so it would not be a good idea to store whole list into one single object.

I managed doing this but how do i iterate through this or how do i extract symbols out of it?

Think, how do you get anything from a list?

I get that but to iterate i need to know its length and should i do something like --> list[‘symbols’] or so?

There are predefined java functions for knowing length of lists, you can easily get the length.

Yeah but i am not able to access the ‘symbol’ part out of it

Read and understand the POJO class, there is definitely a way to access the symbols.

where can i find the POJO class, i am not able to find it anywhere

I mean where can i see the class structure and all that so i can understand deeper

I figured it out, thanks a lot for the help

Please close this topic if you found your solution.