May 2019
Intermediate to advanced
546 pages
12h 41m
English
In this section, you will find the code solution for the Person object. We will reuse the MovieResponse object because the service provides a list of different movies in which the person has acted.
This is the full class for the Person object:
public class Person { public Decimal popularity {get; set;} public Integer id {get; set;} public String profile_path {get; set;} public String name {get; set;} public List<MovieResponse> known_for {get; set;}}
This is the method that converts the JSON response into the Person object:
private static List<Person> constructPersons(String sResponse){ List<Person> lstPersons = new List<Person>(); if (sResponse != null){ JSONParser theParser = JSON.createParser(sResponse); ...Read now
Unlock full access