How to map an API call object correctly to a Java object?
<p>I am working to retrieve data from an API call. For the login part, a simple text response is sent by the site to which I am connecting.</p>

<p>Sample response is given below:</p>

<pre><code>{"code": "OK", 
"data": {"session_id": "myemail@domain.com:uJoaY1KlTWBchJpGHeZVZWs3"}, 
"user": "myemail@domain.com"}
</code></pre>

<p>I want to extract the various values from above response. What kind of object do I have to create that maps correctly to each of the elements in the response? Also, I thought of using a hashmap as part of my object- is that the correct approach? What is the best way to map the above data to a Java object? </p>
