Rename Person to PersonInfo

Matches rest of the methods
master
Stuart Boston 11 years ago
parent c2887f2f8c
commit 7c72a1fa92

@ -77,7 +77,7 @@ import com.omertron.themoviedbapi.model.network.Network;
import com.omertron.themoviedbapi.model.person.ContentRating;
import com.omertron.themoviedbapi.model.person.CreditInfo;
import com.omertron.themoviedbapi.model.person.ExternalID;
import com.omertron.themoviedbapi.model.person.Person;
import com.omertron.themoviedbapi.model.person.PersonInfo;
import com.omertron.themoviedbapi.model.person.PersonCreditList;
import com.omertron.themoviedbapi.model.person.PersonFind;
import com.omertron.themoviedbapi.model.review.Review;
@ -464,7 +464,7 @@ public class TheMovieDbApi {
}
/**
* Get a list of Person IDs that have been edited.
* Get a list of PersonInfo IDs that have been edited.
*
* You can then use the person changes API to get the actual data that has been changed.
*
@ -1118,7 +1118,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public Person getPersonInfo(int personId, String... appendToResponse) throws MovieDbException {
public PersonInfo getPersonInfo(int personId, String... appendToResponse) throws MovieDbException {
return tmdbPeople.getPersonInfo(personId, appendToResponse);
}
@ -1246,7 +1246,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public Person getPersonLatest() throws MovieDbException {
public PersonInfo getPersonLatest() throws MovieDbException {
return tmdbPeople.getPersonLatest();
}
//</editor-fold>

@ -33,7 +33,7 @@ import com.omertron.themoviedbapi.model.media.AlternativeTitle;
import com.omertron.themoviedbapi.model.movie.MovieBasic;
import com.omertron.themoviedbapi.model.movie.MovieInfo;
import com.omertron.themoviedbapi.model.person.ContentRating;
import com.omertron.themoviedbapi.model.person.Person;
import com.omertron.themoviedbapi.model.person.PersonInfo;
import com.omertron.themoviedbapi.model.person.PersonFind;
import com.omertron.themoviedbapi.model.review.Review;
import com.omertron.themoviedbapi.model.tv.TVBasic;
@ -84,7 +84,7 @@ public class AbstractMethod {
});
TYPE_REFS.put(MovieInfo.class, new TypeReference<WrapperGenericList<MovieInfo>>() {
});
TYPE_REFS.put(Person.class, new TypeReference<WrapperGenericList<Person>>() {
TYPE_REFS.put(PersonInfo.class, new TypeReference<WrapperGenericList<PersonInfo>>() {
});
TYPE_REFS.put(PersonFind.class, new TypeReference<WrapperGenericList<PersonFind>>() {
});

@ -31,7 +31,7 @@ import com.omertron.themoviedbapi.model.credits.CreditBasic;
import com.omertron.themoviedbapi.model.credits.CreditMovieBasic;
import com.omertron.themoviedbapi.model.credits.CreditTVBasic;
import com.omertron.themoviedbapi.model.person.ExternalID;
import com.omertron.themoviedbapi.model.person.Person;
import com.omertron.themoviedbapi.model.person.PersonInfo;
import com.omertron.themoviedbapi.model.person.PersonCreditList;
import com.omertron.themoviedbapi.model.person.PersonCreditsMixIn;
import com.omertron.themoviedbapi.model.person.PersonFind;
@ -73,7 +73,7 @@ public class TmdbPeople extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public Person getPersonInfo(int personId, String... appendToResponse) throws MovieDbException {
public PersonInfo getPersonInfo(int personId, String... appendToResponse) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.APPEND, appendToResponse);
@ -82,7 +82,7 @@ public class TmdbPeople extends AbstractMethod {
String webpage = httpTools.getRequest(url);
try {
return MAPPER.readValue(webpage, Person.class);
return MAPPER.readValue(webpage, PersonInfo.class);
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person info", url, ex);
}
@ -297,12 +297,12 @@ public class TmdbPeople extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public Person getPersonLatest() throws MovieDbException {
public PersonInfo getPersonLatest() throws MovieDbException {
URL url = new ApiUrl(apiKey, MethodBase.PERSON).subMethod(MethodSub.LATEST).buildUrl();
String webpage = httpTools.getRequest(url);
try {
return MAPPER.readValue(webpage, Person.class);
return MAPPER.readValue(webpage, PersonInfo.class);
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get latest person", url, ex);
}

@ -26,7 +26,7 @@ import java.util.List;
/**
* @author stuart.boston
*/
public class Person extends PersonBasic implements Serializable {
public class PersonInfo extends PersonBasic implements Serializable {
private static final long serialVersionUID = 4L;

@ -27,7 +27,7 @@ import com.omertron.themoviedbapi.interfaces.IIdentification;
import com.omertron.themoviedbapi.model.media.MediaCreditList;
import com.omertron.themoviedbapi.model.movie.MovieInfo;
import com.omertron.themoviedbapi.model.person.ExternalID;
import com.omertron.themoviedbapi.model.person.Person;
import com.omertron.themoviedbapi.model.person.PersonInfo;
import com.omertron.themoviedbapi.model.tv.TVEpisodeInfo;
import com.omertron.themoviedbapi.model.tv.TVInfo;
import com.omertron.themoviedbapi.model.tv.TVSeasonInfo;
@ -112,7 +112,7 @@ public class TestSuite {
assertTrue(message + ": Missing guest stars", test.getGuestStars().size() > 0);
}
public static void test(Person test) {
public static void test(PersonInfo test) {
String message = test.getClass().getSimpleName();
assertTrue(message + ": Missing bio", StringUtils.isNotBlank(test.getBiography()));
assertTrue(message + ": Missing birthday", StringUtils.isNotBlank(test.getBirthday()));

@ -33,7 +33,7 @@ import com.omertron.themoviedbapi.model.credits.CreditBasic;
import com.omertron.themoviedbapi.model.credits.CreditMovieBasic;
import com.omertron.themoviedbapi.model.credits.CreditTVBasic;
import com.omertron.themoviedbapi.model.person.ExternalID;
import com.omertron.themoviedbapi.model.person.Person;
import com.omertron.themoviedbapi.model.person.PersonInfo;
import com.omertron.themoviedbapi.model.person.PersonCreditList;
import com.omertron.themoviedbapi.model.person.PersonFind;
import com.omertron.themoviedbapi.results.ResultList;
@ -94,7 +94,7 @@ public class TmdbPeopleTest extends AbstractTests {
@Test
public void testGetPersonInfo() throws MovieDbException {
LOG.info("getPersonInfo");
Person result;
PersonInfo result;
for (TestID test : testIDs) {
result = instance.getPersonInfo(test.getTmdb());
@ -302,7 +302,7 @@ public class TmdbPeopleTest extends AbstractTests {
@Test
public void testGetPersonLatest() throws MovieDbException {
LOG.info("getPersonLatest");
Person result = instance.getPersonLatest();
PersonInfo result = instance.getPersonLatest();
// All we get on the latest person is usually id and name
assertTrue("No id", result.getId() > 0);
assertTrue("No name", StringUtils.isNotBlank(result.getName()));

Loading…
Cancel
Save