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.ContentRating;
import com.omertron.themoviedbapi.model.person.CreditInfo; import com.omertron.themoviedbapi.model.person.CreditInfo;
import com.omertron.themoviedbapi.model.person.ExternalID; 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.PersonCreditList;
import com.omertron.themoviedbapi.model.person.PersonFind; import com.omertron.themoviedbapi.model.person.PersonFind;
import com.omertron.themoviedbapi.model.review.Review; 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. * 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 * @return
* @throws MovieDbException * @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); return tmdbPeople.getPersonInfo(personId, appendToResponse);
} }
@ -1246,7 +1246,7 @@ public class TheMovieDbApi {
* @return * @return
* @throws MovieDbException * @throws MovieDbException
*/ */
public Person getPersonLatest() throws MovieDbException { public PersonInfo getPersonLatest() throws MovieDbException {
return tmdbPeople.getPersonLatest(); return tmdbPeople.getPersonLatest();
} }
//</editor-fold> //</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.MovieBasic;
import com.omertron.themoviedbapi.model.movie.MovieInfo; import com.omertron.themoviedbapi.model.movie.MovieInfo;
import com.omertron.themoviedbapi.model.person.ContentRating; 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.person.PersonFind;
import com.omertron.themoviedbapi.model.review.Review; import com.omertron.themoviedbapi.model.review.Review;
import com.omertron.themoviedbapi.model.tv.TVBasic; 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(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>>() { 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.CreditMovieBasic;
import com.omertron.themoviedbapi.model.credits.CreditTVBasic; import com.omertron.themoviedbapi.model.credits.CreditTVBasic;
import com.omertron.themoviedbapi.model.person.ExternalID; 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.PersonCreditList;
import com.omertron.themoviedbapi.model.person.PersonCreditsMixIn; import com.omertron.themoviedbapi.model.person.PersonCreditsMixIn;
import com.omertron.themoviedbapi.model.person.PersonFind; import com.omertron.themoviedbapi.model.person.PersonFind;
@ -73,7 +73,7 @@ public class TmdbPeople extends AbstractMethod {
* @return * @return
* @throws MovieDbException * @throws MovieDbException
*/ */
public Person getPersonInfo(int personId, String... appendToResponse) throws MovieDbException { public PersonInfo getPersonInfo(int personId, String... appendToResponse) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters(); TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId); parameters.add(Param.ID, personId);
parameters.add(Param.APPEND, appendToResponse); parameters.add(Param.APPEND, appendToResponse);
@ -82,7 +82,7 @@ public class TmdbPeople extends AbstractMethod {
String webpage = httpTools.getRequest(url); String webpage = httpTools.getRequest(url);
try { try {
return MAPPER.readValue(webpage, Person.class); return MAPPER.readValue(webpage, PersonInfo.class);
} catch (IOException ex) { } catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person info", url, ex); throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person info", url, ex);
} }
@ -297,12 +297,12 @@ public class TmdbPeople extends AbstractMethod {
* @return * @return
* @throws MovieDbException * @throws MovieDbException
*/ */
public Person getPersonLatest() throws MovieDbException { public PersonInfo getPersonLatest() throws MovieDbException {
URL url = new ApiUrl(apiKey, MethodBase.PERSON).subMethod(MethodSub.LATEST).buildUrl(); URL url = new ApiUrl(apiKey, MethodBase.PERSON).subMethod(MethodSub.LATEST).buildUrl();
String webpage = httpTools.getRequest(url); String webpage = httpTools.getRequest(url);
try { try {
return MAPPER.readValue(webpage, Person.class); return MAPPER.readValue(webpage, PersonInfo.class);
} catch (IOException ex) { } catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get latest person", url, 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 * @author stuart.boston
*/ */
public class Person extends PersonBasic implements Serializable { public class PersonInfo extends PersonBasic implements Serializable {
private static final long serialVersionUID = 4L; 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.media.MediaCreditList;
import com.omertron.themoviedbapi.model.movie.MovieInfo; import com.omertron.themoviedbapi.model.movie.MovieInfo;
import com.omertron.themoviedbapi.model.person.ExternalID; 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.TVEpisodeInfo;
import com.omertron.themoviedbapi.model.tv.TVInfo; import com.omertron.themoviedbapi.model.tv.TVInfo;
import com.omertron.themoviedbapi.model.tv.TVSeasonInfo; import com.omertron.themoviedbapi.model.tv.TVSeasonInfo;
@ -112,7 +112,7 @@ public class TestSuite {
assertTrue(message + ": Missing guest stars", test.getGuestStars().size() > 0); 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(); String message = test.getClass().getSimpleName();
assertTrue(message + ": Missing bio", StringUtils.isNotBlank(test.getBiography())); assertTrue(message + ": Missing bio", StringUtils.isNotBlank(test.getBiography()));
assertTrue(message + ": Missing birthday", StringUtils.isNotBlank(test.getBirthday())); 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.CreditMovieBasic;
import com.omertron.themoviedbapi.model.credits.CreditTVBasic; import com.omertron.themoviedbapi.model.credits.CreditTVBasic;
import com.omertron.themoviedbapi.model.person.ExternalID; 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.PersonCreditList;
import com.omertron.themoviedbapi.model.person.PersonFind; import com.omertron.themoviedbapi.model.person.PersonFind;
import com.omertron.themoviedbapi.results.ResultList; import com.omertron.themoviedbapi.results.ResultList;
@ -94,7 +94,7 @@ public class TmdbPeopleTest extends AbstractTests {
@Test @Test
public void testGetPersonInfo() throws MovieDbException { public void testGetPersonInfo() throws MovieDbException {
LOG.info("getPersonInfo"); LOG.info("getPersonInfo");
Person result; PersonInfo result;
for (TestID test : testIDs) { for (TestID test : testIDs) {
result = instance.getPersonInfo(test.getTmdb()); result = instance.getPersonInfo(test.getTmdb());
@ -302,7 +302,7 @@ public class TmdbPeopleTest extends AbstractTests {
@Test @Test
public void testGetPersonLatest() throws MovieDbException { public void testGetPersonLatest() throws MovieDbException {
LOG.info("getPersonLatest"); LOG.info("getPersonLatest");
Person result = instance.getPersonLatest(); PersonInfo result = instance.getPersonLatest();
// All we get on the latest person is usually id and name // All we get on the latest person is usually id and name
assertTrue("No id", result.getId() > 0); assertTrue("No id", result.getId() > 0);
assertTrue("No name", StringUtils.isNotBlank(result.getName())); assertTrue("No name", StringUtils.isNotBlank(result.getName()));

Loading…
Cancel
Save