diff --git a/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java b/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java index 5d9a8f9fa..8cc1365a8 100644 --- a/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java +++ b/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java @@ -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(); } // diff --git a/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java b/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java index b6494cbbe..ae33a42a2 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java @@ -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>() { }); - TYPE_REFS.put(Person.class, new TypeReference>() { + TYPE_REFS.put(PersonInfo.class, new TypeReference>() { }); TYPE_REFS.put(PersonFind.class, new TypeReference>() { }); diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java index bcac45c7a..22f2f59f1 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java @@ -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); } diff --git a/src/main/java/com/omertron/themoviedbapi/model/person/Person.java b/src/main/java/com/omertron/themoviedbapi/model/person/PersonInfo.java similarity index 97% rename from src/main/java/com/omertron/themoviedbapi/model/person/Person.java rename to src/main/java/com/omertron/themoviedbapi/model/person/PersonInfo.java index 239bf24d6..f61a2b648 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/person/Person.java +++ b/src/main/java/com/omertron/themoviedbapi/model/person/PersonInfo.java @@ -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; diff --git a/src/test/java/com/omertron/themoviedbapi/TestSuite.java b/src/test/java/com/omertron/themoviedbapi/TestSuite.java index 010762ba3..bd327c69b 100644 --- a/src/test/java/com/omertron/themoviedbapi/TestSuite.java +++ b/src/test/java/com/omertron/themoviedbapi/TestSuite.java @@ -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())); diff --git a/src/test/java/com/omertron/themoviedbapi/methods/TmdbPeopleTest.java b/src/test/java/com/omertron/themoviedbapi/methods/TmdbPeopleTest.java index 82f8d4160..f729f0699 100644 --- a/src/test/java/com/omertron/themoviedbapi/methods/TmdbPeopleTest.java +++ b/src/test/java/com/omertron/themoviedbapi/methods/TmdbPeopleTest.java @@ -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()));