Partial Movies

This commit is contained in:
Stuart Boston
2015-03-03 17:45:15 +00:00
parent 4db6d22d5b
commit d80f15a52d
25 changed files with 468 additions and 159 deletions
@@ -42,7 +42,6 @@ import com.omertron.themoviedbapi.methods.TmdbPeople;
import com.omertron.themoviedbapi.methods.TmdbReviews;
import com.omertron.themoviedbapi.methods.TmdbSearch;
import com.omertron.themoviedbapi.methods.TmdbTV;
import com.omertron.themoviedbapi.model.AlternativeTitle;
import com.omertron.themoviedbapi.model.Genre;
import com.omertron.themoviedbapi.model.MovieDb;
import com.omertron.themoviedbapi.model.MovieList;
@@ -52,7 +51,7 @@ import com.omertron.themoviedbapi.model.Video;
import com.omertron.themoviedbapi.model.keyword.KeywordMovie;
import com.omertron.themoviedbapi.model2.Certification;
import com.omertron.themoviedbapi.model2.FindResults;
import com.omertron.themoviedbapi.model2.MediaBasic;
import com.omertron.themoviedbapi.model2.media.MediaBasic;
import com.omertron.themoviedbapi.model2.StatusCode;
import com.omertron.themoviedbapi.model2.account.Account;
import com.omertron.themoviedbapi.model2.artwork.Artwork;
@@ -69,11 +68,10 @@ import com.omertron.themoviedbapi.model2.discover.Discover;
import com.omertron.themoviedbapi.model2.keyword.Keyword;
import com.omertron.themoviedbapi.model2.list.ListItem;
import com.omertron.themoviedbapi.model2.list.UserList;
import com.omertron.themoviedbapi.model2.movie.AlternativeTitle;
import com.omertron.themoviedbapi.model2.movie.MovieBasic;
import com.omertron.themoviedbapi.model2.network.Network;
import com.omertron.themoviedbapi.model2.person.CreditInfo;
import com.omertron.themoviedbapi.model2.person.CreditMovieBasic;
import com.omertron.themoviedbapi.model2.person.CreditTVBasic;
import com.omertron.themoviedbapi.model2.person.ExternalID;
import com.omertron.themoviedbapi.model2.person.Person;
import com.omertron.themoviedbapi.model2.person.PersonCredits;
@@ -1225,7 +1223,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public PersonCredits<CreditMovieBasic> getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
public PersonCredits getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
return tmdbPeople.getPersonMovieCredits(personId, language, appendToResponse);
}
@@ -1244,7 +1242,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public PersonCredits<CreditTVBasic> getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
public PersonCredits getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
return tmdbPeople.getPersonTVCredits(personId, language, appendToResponse);
}
@@ -1263,7 +1261,7 @@ public class TheMovieDbApi {
* @return
* @throws MovieDbException
*/
public PersonCredits<CreditTVBasic> getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
public PersonCredits getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
return tmdbPeople.getPersonCombinedCredits(personId, language, appendToResponse);
}
@@ -20,16 +20,17 @@
package com.omertron.themoviedbapi.methods;
import com.omertron.themoviedbapi.MovieDbException;
import com.omertron.themoviedbapi.model.AlternativeTitle;
import com.omertron.themoviedbapi.model.MovieDb;
import com.omertron.themoviedbapi.model.MovieList;
import com.omertron.themoviedbapi.model.ReleaseInfo;
import com.omertron.themoviedbapi.model.Translation;
import com.omertron.themoviedbapi.model.Video;
import com.omertron.themoviedbapi.model.person.Person;
import com.omertron.themoviedbapi.model2.media.MediaState;
import com.omertron.themoviedbapi.model2.StatusCode;
import com.omertron.themoviedbapi.model2.artwork.Artwork;
import com.omertron.themoviedbapi.model2.keyword.Keyword;
import com.omertron.themoviedbapi.model2.media.MediaCreditList;
import com.omertron.themoviedbapi.model2.movie.AlternativeTitle;
import com.omertron.themoviedbapi.results.TmdbResultsList;
import com.omertron.themoviedbapi.tools.ApiUrl;
import com.omertron.themoviedbapi.tools.HttpTools;
@@ -42,7 +43,6 @@ import com.omertron.themoviedbapi.tools.TmdbParameters;
import com.omertron.themoviedbapi.wrapper.WrapperAlternativeTitles;
import com.omertron.themoviedbapi.wrapper.WrapperImages;
import com.omertron.themoviedbapi.wrapper.WrapperMovie;
import com.omertron.themoviedbapi.wrapper.WrapperMovieCasts;
import com.omertron.themoviedbapi.wrapper.WrapperMovieKeywords;
import com.omertron.themoviedbapi.wrapper.WrapperMovieList;
import com.omertron.themoviedbapi.wrapper.WrapperReleaseInfo;
@@ -150,14 +150,19 @@ public class TmdbMovies extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public String getMovieAccountState(int movieId, String sessionId) throws MovieDbException {
public MediaState getMovieAccountState(int movieId, String sessionId) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, movieId);
parameters.add(Param.SESSION, sessionId);
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).buildUrl(parameters);
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).setSubMethod(MethodSub.ACCOUNT_STATES).buildUrl(parameters);
String webpage = httpTools.getRequest(url);
return null;
try {
return MAPPER.readValue(webpage, MediaState.class);
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get movie info", url, ex);
}
}
/**
@@ -196,41 +201,17 @@ public class TmdbMovies extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public String getMovieCredits(int movieId, String... appendToResponse) throws MovieDbException {
public MediaCreditList getMovieCredits(int movieId, String... appendToResponse) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, movieId);
parameters.add(Param.APPEND, appendToResponse);
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).buildUrl(parameters);
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).setSubMethod(MethodSub.CREDITS).buildUrl(parameters);
String webpage = httpTools.getRequest(url);
return null;
}
/**
* Get the cast information for a specific movie id.
*
* TODO: Add a function to enrich the data with the people methods
*
* @param movieId
* @param appendToResponse
* @return
* @throws MovieDbException
*/
public TmdbResultsList<Person> getMovieCasts(int movieId, String... appendToResponse) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, movieId);
parameters.add(Param.APPEND, appendToResponse);
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).setSubMethod(MethodSub.CASTS).buildUrl(parameters);
String webpage = httpTools.getRequest(url);
try {
WrapperMovieCasts wrapper = MAPPER.readValue(webpage, WrapperMovieCasts.class);
TmdbResultsList<Person> results = new TmdbResultsList<Person>(wrapper.getAll());
results.copyWrapper(wrapper);
return results;
return MAPPER.readValue(webpage, MediaCreditList.class);
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get movie casts", url, ex);
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get movie credits", url, ex);
}
}
@@ -24,9 +24,6 @@ import com.omertron.themoviedbapi.MovieDbException;
import com.omertron.themoviedbapi.enumeration.ArtworkType;
import com.omertron.themoviedbapi.model2.artwork.Artwork;
import com.omertron.themoviedbapi.model2.artwork.ArtworkMedia;
import com.omertron.themoviedbapi.model2.person.CreditBasic;
import com.omertron.themoviedbapi.model2.person.CreditMovieBasic;
import com.omertron.themoviedbapi.model2.person.CreditTVBasic;
import com.omertron.themoviedbapi.model2.person.ExternalID;
import com.omertron.themoviedbapi.model2.person.Person;
import com.omertron.themoviedbapi.model2.person.PersonCredits;
@@ -94,7 +91,7 @@ public class TmdbPeople extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public PersonCredits<CreditMovieBasic> getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
public PersonCredits getPersonMovieCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
@@ -104,8 +101,7 @@ public class TmdbPeople extends AbstractMethod {
String webpage = httpTools.getRequest(url);
try {
return MAPPER.readValue(webpage, new TypeReference<PersonCredits<CreditMovieBasic>>() {
});
return MAPPER.readValue(webpage, PersonCredits.class);
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person movie credits", url, ex);
}
@@ -126,7 +122,7 @@ public class TmdbPeople extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public PersonCredits<CreditTVBasic> getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
public PersonCredits getPersonTVCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
@@ -136,8 +132,7 @@ public class TmdbPeople extends AbstractMethod {
String webpage = httpTools.getRequest(url);
try {
return MAPPER.readValue(webpage, new TypeReference<PersonCredits<CreditTVBasic>>() {
});
return MAPPER.readValue(webpage, PersonCredits.class);
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person TV credits", url, ex);
}
@@ -158,7 +153,7 @@ public class TmdbPeople extends AbstractMethod {
* @return
* @throws MovieDbException
*/
public PersonCredits<CreditTVBasic> getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
public PersonCredits getPersonCombinedCredits(int personId, String language, String... appendToResponse) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
@@ -168,8 +163,7 @@ public class TmdbPeople extends AbstractMethod {
String webpage = httpTools.getRequest(url);
try {
return MAPPER.readValue(webpage, new TypeReference<PersonCredits<? extends CreditBasic>>() {
});
return MAPPER.readValue(webpage, PersonCredits.class);
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person combined credits", url, ex);
}
@@ -23,7 +23,7 @@ import com.omertron.themoviedbapi.MovieDbException;
import com.omertron.themoviedbapi.enumeration.SearchType;
import static com.omertron.themoviedbapi.methods.AbstractMethod.MAPPER;
import com.omertron.themoviedbapi.model.MovieDb;
import com.omertron.themoviedbapi.model2.MediaBasic;
import com.omertron.themoviedbapi.model2.media.MediaBasic;
import com.omertron.themoviedbapi.model2.keyword.Keyword;
import com.omertron.themoviedbapi.model2.collection.Collection;
import com.omertron.themoviedbapi.model2.company.Company;
@@ -19,14 +19,15 @@
*/
package com.omertron.themoviedbapi.model;
import com.omertron.themoviedbapi.model2.artwork.Artwork;
import com.omertron.themoviedbapi.model2.review.Review;
import com.omertron.themoviedbapi.model2.AbstractJsonMapping;
import com.omertron.themoviedbapi.model2.collection.Collection;
import com.omertron.themoviedbapi.model2.keyword.Keyword;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.person.PersonCast;
import com.omertron.themoviedbapi.model.person.PersonCrew;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model2.AbstractJsonMapping;
import com.omertron.themoviedbapi.model2.artwork.Artwork;
import com.omertron.themoviedbapi.model2.collection.Collection;
import com.omertron.themoviedbapi.model2.keyword.Keyword;
import com.omertron.themoviedbapi.model2.movie.AlternativeTitle;
import com.omertron.themoviedbapi.model2.review.Review;
import com.omertron.themoviedbapi.wrapper.WrapperAlternativeTitles;
import com.omertron.themoviedbapi.wrapper.WrapperImages;
import com.omertron.themoviedbapi.wrapper.WrapperMovie;
@@ -24,7 +24,7 @@ import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.omertron.themoviedbapi.enumeration.MediaType;
import com.omertron.themoviedbapi.model2.MediaBasic;
import com.omertron.themoviedbapi.model2.media.MediaBasic;
import com.omertron.themoviedbapi.model2.movie.MovieBasic;
import com.omertron.themoviedbapi.model2.tv.TVBasic;
import com.omertron.themoviedbapi.model2.tv.TVEpisodeBasic;
@@ -17,9 +17,10 @@
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model2;
package com.omertron.themoviedbapi.model2.media;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model2.AbstractJsonMapping;
/**
* Basic media information
@@ -0,0 +1,72 @@
/*
* Copyright (c) 2004-2015 Stuart Boston
*
* This file is part of TheMovieDB API.
*
* TheMovieDB API is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* TheMovieDB API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model2.media;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model2.AbstractJsonMapping;
/**
*
* @author Stuart.Boston
*/
public class MediaCredit extends AbstractJsonMapping {
@JsonProperty("credit_id")
private String creditId;
@JsonProperty("id")
private int id;
@JsonProperty("profile_path")
private String profilePath;
@JsonProperty("name")
private String name;
public String getCreditId() {
return creditId;
}
public void setCreditId(String creditId) {
this.creditId = creditId;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getProfilePath() {
return profilePath;
}
public void setProfilePath(String profilePath) {
this.profilePath = profilePath;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@@ -0,0 +1,61 @@
/*
* Copyright (c) 2004-2015 Stuart Boston
*
* This file is part of TheMovieDB API.
*
* TheMovieDB API is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* TheMovieDB API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model2.media;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* @author Stuart.Boston
*/
public class MediaCreditCast extends MediaCredit {
@JsonProperty("cast_id")
private int castId = 0;
@JsonProperty("character")
private String character;
@JsonProperty("order")
private int order;
public int getCastId() {
return castId;
}
public void setCastId(int castId) {
this.castId = castId;
}
public String getCharacter() {
return character;
}
public void setCharacter(String character) {
this.character = character;
}
public int getOrder() {
return order;
}
public void setOrder(int order) {
this.order = order;
}
}
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2004-2015 Stuart Boston
*
* This file is part of TheMovieDB API.
*
* TheMovieDB API is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* TheMovieDB API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model2.media;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* @author Stuart.Boston
*/
public class MediaCreditCrew extends MediaCredit {
@JsonProperty("department")
private String department;
@JsonProperty("job")
private String job;
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getJob() {
return job;
}
public void setJob(String job) {
this.job = job;
}
}
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2004-2015 Stuart Boston
*
* This file is part of TheMovieDB API.
*
* TheMovieDB API is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* TheMovieDB API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model2.media;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model2.AbstractJsonMapping;
import java.util.List;
/**
* @author stuart.boston
*/
public class MediaCreditList extends AbstractJsonMapping {
private static final long serialVersionUID = 1L;
@JsonProperty("id")
private int id;
@JsonProperty("cast")
private List<MediaCreditCast> cast;
@JsonProperty("crew")
private List<MediaCreditCrew> crew;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public List<MediaCreditCast> getCast() {
return cast;
}
public void setCast(List<MediaCreditCast> cast) {
this.cast = cast;
}
public List<MediaCreditCrew> getCrew() {
return crew;
}
public void setCrew(List<MediaCreditCrew> crew) {
this.crew = crew;
}
}
@@ -0,0 +1,85 @@
/*
* Copyright (c) 2004-2015 Stuart Boston
*
* This file is part of TheMovieDB API.
*
* TheMovieDB API is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* TheMovieDB API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model2.media;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model2.AbstractJsonMapping;
/**
*
* @author Stuart.Boston
*/
public class MediaState extends AbstractJsonMapping {
@JsonProperty("id")
private int id;
@JsonProperty("favorite")
private boolean favorite;
@JsonProperty("watchlist")
private boolean watchlist;
@JsonProperty("rated")
private RatedValue rated;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public boolean isFavorite() {
return favorite;
}
public void setFavorite(boolean favorite) {
this.favorite = favorite;
}
public boolean isWatchlist() {
return watchlist;
}
public void setWatchlist(boolean watchlist) {
this.watchlist = watchlist;
}
public float getRated() {
return rated.getValue();
}
public void setRated(RatedValue rated) {
this.rated = rated;
}
public class RatedValue extends AbstractJsonMapping {
@JsonProperty("value")
private float value = -1f;
public float getValue() {
return value;
}
public void setValue(float value) {
this.value = value;
}
}
}
@@ -17,7 +17,7 @@
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model;
package com.omertron.themoviedbapi.model2.movie;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
@@ -20,7 +20,7 @@
package com.omertron.themoviedbapi.model2.movie;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model2.MediaBasic;
import com.omertron.themoviedbapi.model2.media.MediaBasic;
/**
* Basic Movie information
@@ -24,23 +24,19 @@ import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.omertron.themoviedbapi.model2.AbstractJsonMapping;
import com.omertron.themoviedbapi.model2.MediaBasic;
import java.util.List;
/**
* @author stuart.boston
* @param <T>
*/
public class PersonCredits<T> extends AbstractJsonMapping {
public class PersonCredits extends AbstractJsonMapping {
private static final long serialVersionUID = 1L;
@JsonProperty("id")
private int id;
// @JsonProperty("cast")
private List<T> cast;
// @JsonProperty("crew")
private List<T> crew;
private List<? extends CreditBasic> cast;
private List<? extends CreditBasic> crew;
public int getId() {
return id;
@@ -50,7 +46,7 @@ public class PersonCredits<T> extends AbstractJsonMapping {
this.id = id;
}
public List<T> getCast() {
public List<? extends CreditBasic> getCast() {
return cast;
}
@@ -58,18 +54,18 @@ public class PersonCredits<T> extends AbstractJsonMapping {
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "media_type",
defaultImpl = MediaBasic.class
defaultImpl = CreditBasic.class
)
@JsonSubTypes({
@JsonSubTypes.Type(value = CreditMovieBasic.class, name = "movie"),
@JsonSubTypes.Type(value = CreditTVBasic.class, name = "tv")
})
@JsonSetter("cast")
public void setCast(List<T> cast) {
public void setCast(List<? extends CreditBasic> cast) {
this.cast = cast;
}
public List<T> getCrew() {
public List<? extends CreditBasic> getCrew() {
return crew;
}
@@ -77,14 +73,14 @@ public class PersonCredits<T> extends AbstractJsonMapping {
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.PROPERTY,
property = "media_type",
defaultImpl = MediaBasic.class
defaultImpl = CreditBasic.class
)
@JsonSubTypes({
@JsonSubTypes.Type(value = CreditMovieBasic.class, name = "movie"),
@JsonSubTypes.Type(value = CreditTVBasic.class, name = "tv")
})
@JsonSetter("crew")
public void setCrew(List<T> crew) {
public void setCrew(List<? extends CreditBasic> crew) {
this.crew = crew;
}
}
@@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.omertron.themoviedbapi.model2.MediaBasic;
import com.omertron.themoviedbapi.model2.media.MediaBasic;
import com.omertron.themoviedbapi.model2.movie.MovieBasic;
import com.omertron.themoviedbapi.model2.tv.TVBasic;
import com.omertron.themoviedbapi.model2.tv.TVEpisodeBasic;
@@ -20,7 +20,7 @@
package com.omertron.themoviedbapi.model2.tv;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model2.MediaBasic;
import com.omertron.themoviedbapi.model2.media.MediaBasic;
import java.util.List;
/**
@@ -20,7 +20,7 @@
package com.omertron.themoviedbapi.model2.tv;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model2.MediaBasic;
import com.omertron.themoviedbapi.model2.media.MediaBasic;
/**
* TV Favorite information
@@ -24,6 +24,7 @@ import org.apache.commons.lang3.StringUtils;
public enum MethodSub {
ACCOUNT_STATES("account_states"),
ADD_ITEM("add_item"),
ALT_TITLES("alternative_titles"),
CASTS("casts"),
@@ -20,7 +20,7 @@
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.AlternativeTitle;
import com.omertron.themoviedbapi.model2.movie.AlternativeTitle;
import java.io.Serializable;
import java.util.List;
@@ -22,7 +22,7 @@ package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.omertron.themoviedbapi.model2.MediaBasic;
import com.omertron.themoviedbapi.model2.media.MediaBasic;
import com.omertron.themoviedbapi.model2.movie.MovieBasic;
import com.omertron.themoviedbapi.model2.tv.TVBasic;
import com.omertron.themoviedbapi.model2.tv.TVEpisodeBasic;