Removed Log4J dependency and switched to SLF4J

This commit is contained in:
Omertron
2013-02-24 18:58:27 +00:00
parent 618406b459
commit 1b62ae2ff8
55 changed files with 3915 additions and 3946 deletions
+11 -5
View File
@@ -80,11 +80,6 @@
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
@@ -110,6 +105,17 @@
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
@@ -24,7 +24,6 @@ import com.omertron.themoviedbapi.MovieDbException.MovieDbExceptionType;
import com.omertron.themoviedbapi.model.*;
import com.omertron.themoviedbapi.tools.ApiUrl;
import static com.omertron.themoviedbapi.tools.ApiUrl.*;
import com.omertron.themoviedbapi.tools.FilteringLayout;
import com.omertron.themoviedbapi.tools.WebBrowser;
import com.omertron.themoviedbapi.wrapper.*;
import java.io.IOException;
@@ -33,7 +32,8 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The MovieDb API <p> This is for version 3 of the API as specified here: http://help.themoviedb.org/kb/api/about-3
@@ -42,7 +42,7 @@ import org.apache.log4j.Logger;
*/
public class TheMovieDbApi {
private static final Logger logger = Logger.getLogger(TheMovieDbApi.class);
private static final Logger LOG = LoggerFactory.getLogger(TheMovieDbApi.class);
private String apiKey;
private TmdbConfiguration tmdbConfig;
/*
@@ -86,7 +86,6 @@ public class TheMovieDbApi {
ApiUrl apiUrl = new ApiUrl(this, "configuration");
URL configUrl = apiUrl.buildUrl();
String webpage = WebBrowser.request(configUrl);
FilteringLayout.addReplacementString(apiKey);
try {
WrapperConfig wc = mapper.readValue(webpage, WrapperConfig.class);
@@ -228,7 +227,7 @@ public class TheMovieDbApi {
try {
return (new URL(sb.toString()));
} catch (MalformedURLException ex) {
logger.warn("Failed to create image URL: " + ex.getMessage());
LOG.warn("Failed to create image URL: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.INVALID_URL, sb.toString(), ex);
}
}
@@ -256,7 +255,7 @@ public class TheMovieDbApi {
try {
return mapper.readValue(webpage, TokenAuthorisation.class);
} catch (IOException ex) {
logger.warn("Failed to get Authorisation Token: " + ex.getMessage());
LOG.warn("Failed to get Authorisation Token: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.AUTHORISATION_FAILURE, webpage, ex);
}
}
@@ -273,7 +272,7 @@ public class TheMovieDbApi {
ApiUrl apiUrl = new ApiUrl(this, BASE_AUTH, "session/new");
if (!token.getSuccess()) {
logger.warn("Authorisation token was not successful!");
LOG.warn("Authorisation token was not successful!");
throw new MovieDbException(MovieDbExceptionType.AUTHORISATION_FAILURE, "Authorisation token was not successful!");
}
@@ -284,7 +283,7 @@ public class TheMovieDbApi {
try {
return mapper.readValue(webpage, TokenSession.class);
} catch (IOException ex) {
logger.warn("Failed to get Session Token: " + ex.getMessage());
LOG.warn("Failed to get Session Token: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -312,7 +311,7 @@ public class TheMovieDbApi {
try {
return mapper.readValue(webpage, TokenSession.class);
} catch (IOException ex) {
logger.warn("Failed to get Session Token: " + ex.getMessage());
LOG.warn("Failed to get Session Token: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -346,7 +345,7 @@ public class TheMovieDbApi {
try {
return mapper.readValue(webpage, MovieDb.class);
} catch (IOException ex) {
logger.warn("Failed to get movie info: " + ex.getMessage());
LOG.warn("Failed to get movie info: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -374,7 +373,7 @@ public class TheMovieDbApi {
try {
return mapper.readValue(webpage, MovieDb.class);
} catch (IOException ex) {
logger.warn("Failed to get movie info: " + ex.getMessage());
LOG.warn("Failed to get movie info: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -400,7 +399,7 @@ public class TheMovieDbApi {
WrapperAlternativeTitles wrapper = mapper.readValue(webpage, WrapperAlternativeTitles.class);
return wrapper.getTitles();
} catch (IOException ex) {
logger.warn("Failed to get movie alternative titles: " + ex.getMessage());
LOG.warn("Failed to get movie alternative titles: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -440,7 +439,7 @@ public class TheMovieDbApi {
return people;
} catch (IOException ex) {
logger.warn("Failed to get movie casts: " + ex.getMessage());
LOG.warn("Failed to get movie casts: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -480,7 +479,7 @@ public class TheMovieDbApi {
return artwork;
} catch (IOException ex) {
logger.warn("Failed to get movie images: " + ex.getMessage());
LOG.warn("Failed to get movie images: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -504,7 +503,7 @@ public class TheMovieDbApi {
WrapperMovieKeywords wrapper = mapper.readValue(webpage, WrapperMovieKeywords.class);
return wrapper.getKeywords();
} catch (IOException ex) {
logger.warn("Failed to get movie keywords: " + ex.getMessage());
LOG.warn("Failed to get movie keywords: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -528,7 +527,7 @@ public class TheMovieDbApi {
WrapperReleaseInfo wrapper = mapper.readValue(webpage, WrapperReleaseInfo.class);
return wrapper.getCountries();
} catch (IOException ex) {
logger.warn("Failed to get movie release information: " + ex.getMessage());
LOG.warn("Failed to get movie release information: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -570,7 +569,7 @@ public class TheMovieDbApi {
}
return trailers;
} catch (IOException ex) {
logger.warn("Failed to get movie trailers: " + ex.getMessage());
LOG.warn("Failed to get movie trailers: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -592,7 +591,7 @@ public class TheMovieDbApi {
WrapperTranslations wrapper = mapper.readValue(webpage, WrapperTranslations.class);
return wrapper.getTranslations();
} catch (IOException ex) {
logger.warn("Failed to get movie tranlations: " + ex.getMessage());
LOG.warn("Failed to get movie tranlations: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -628,7 +627,7 @@ public class TheMovieDbApi {
WrapperMovie wrapper = mapper.readValue(webpage, WrapperMovie.class);
return wrapper.getMovies();
} catch (IOException ex) {
logger.warn("Failed to get similar movies: " + ex.getMessage());
LOG.warn("Failed to get similar movies: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -660,7 +659,7 @@ public class TheMovieDbApi {
WrapperMovieList wrapper = mapper.readValue(webpage, WrapperMovieList.class);
return wrapper.getMovieList();
} catch (IOException ex) {
logger.warn("Failed to get movie lists: " + ex.getMessage());
LOG.warn("Failed to get movie lists: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -703,7 +702,7 @@ public class TheMovieDbApi {
WrapperChanges wrapper = mapper.readValue(webpage, WrapperChanges.class);
return wrapper.getChanges();
} catch (IOException ex) {
logger.warn("Failed to get movie changes: " + ex.getMessage());
LOG.warn("Failed to get movie changes: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
@@ -721,7 +720,7 @@ public class TheMovieDbApi {
try {
return mapper.readValue(webpage, MovieDb.class);
} catch (IOException ex) {
logger.warn("Failed to get latest movie: " + ex.getMessage());
LOG.warn("Failed to get latest movie: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -753,7 +752,7 @@ public class TheMovieDbApi {
WrapperMovie wrapper = mapper.readValue(webpage, WrapperMovie.class);
return wrapper.getMovies();
} catch (IOException ex) {
logger.warn("Failed to get upcoming movies: " + ex.getMessage());
LOG.warn("Failed to get upcoming movies: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
@@ -788,7 +787,7 @@ public class TheMovieDbApi {
WrapperMovie wrapper = mapper.readValue(webpage, WrapperMovie.class);
return wrapper.getMovies();
} catch (IOException ex) {
logger.warn("Failed to get now playing movies: " + ex.getMessage());
LOG.warn("Failed to get now playing movies: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -822,7 +821,7 @@ public class TheMovieDbApi {
WrapperMovie wrapper = mapper.readValue(webpage, WrapperMovie.class);
return wrapper.getMovies();
} catch (IOException ex) {
logger.warn("Failed to get popular movie list: " + ex.getMessage());
LOG.warn("Failed to get popular movie list: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -856,7 +855,7 @@ public class TheMovieDbApi {
WrapperMovie wrapper = mapper.readValue(webpage, WrapperMovie.class);
return wrapper.getMovies();
} catch (IOException ex) {
logger.warn("Failed to get top rated movies: " + ex.getMessage());
LOG.warn("Failed to get top rated movies: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -905,7 +904,7 @@ public class TheMovieDbApi {
try {
return mapper.readValue(webpage, CollectionInfo.class);
} catch (IOException ex) {
logger.warn("Failed to get collection information: " + ex.getMessage());
LOG.warn("Failed to get collection information: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -946,7 +945,7 @@ public class TheMovieDbApi {
return artwork;
} catch (IOException ex) {
logger.warn("Failed to get collection images: " + ex.getMessage());
LOG.warn("Failed to get collection images: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
@@ -974,7 +973,7 @@ public class TheMovieDbApi {
try {
return mapper.readValue(webpage, Person.class);
} catch (IOException ex) {
logger.warn("Failed to get movie info: " + ex.getMessage());
LOG.warn("Failed to get movie info: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1012,7 +1011,7 @@ public class TheMovieDbApi {
}
return personCredits;
} catch (IOException ex) {
logger.warn("Failed to get person credits: " + ex.getMessage());
LOG.warn("Failed to get person credits: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1043,7 +1042,7 @@ public class TheMovieDbApi {
}
return personImages;
} catch (IOException ex) {
logger.warn("Failed to get person images: " + ex.getMessage());
LOG.warn("Failed to get person images: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1081,7 +1080,7 @@ public class TheMovieDbApi {
try {
return mapper.readValue(webpage, Person.class);
} catch (IOException ex) {
logger.warn("Failed to get latest person: " + ex.getMessage());
LOG.warn("Failed to get latest person: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1106,7 +1105,7 @@ public class TheMovieDbApi {
try {
return mapper.readValue(webpage, Company.class);
} catch (IOException ex) {
logger.warn("Failed to get company information: " + ex.getMessage());
LOG.warn("Failed to get company information: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1143,7 +1142,7 @@ public class TheMovieDbApi {
WrapperCompanyMovies wrapper = mapper.readValue(webpage, WrapperCompanyMovies.class);
return wrapper.getResults();
} catch (IOException ex) {
logger.warn("Failed to get company movies: " + ex.getMessage());
LOG.warn("Failed to get company movies: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1169,7 +1168,7 @@ public class TheMovieDbApi {
WrapperGenres wrapper = mapper.readValue(webpage, WrapperGenres.class);
return wrapper.getGenres();
} catch (IOException ex) {
logger.warn("Failed to get genre list: " + ex.getMessage());
LOG.warn("Failed to get genre list: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1204,7 +1203,7 @@ public class TheMovieDbApi {
WrapperMovie wrapper = mapper.readValue(webpage, WrapperMovie.class);
return wrapper.getMovies();
} catch (IOException ex) {
logger.warn("Failed to get genre movie list: " + ex.getMessage());
LOG.warn("Failed to get genre movie list: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1249,7 +1248,7 @@ public class TheMovieDbApi {
WrapperMovie wrapper = mapper.readValue(webpage, WrapperMovie.class);
return wrapper.getMovies();
} catch (IOException ex) {
logger.warn("Failed to find movie: " + ex.getMessage());
LOG.warn("Failed to find movie: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
@@ -1285,7 +1284,7 @@ public class TheMovieDbApi {
WrapperCollection wrapper = mapper.readValue(webpage, WrapperCollection.class);
return wrapper.getResults();
} catch (IOException ex) {
logger.warn("Failed to find collection: " + ex.getMessage());
LOG.warn("Failed to find collection: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1316,7 +1315,7 @@ public class TheMovieDbApi {
WrapperPerson wrapper = mapper.readValue(webpage, WrapperPerson.class);
return wrapper.getResults();
} catch (IOException ex) {
logger.warn("Failed to find person: " + ex.getMessage());
LOG.warn("Failed to find person: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1351,7 +1350,7 @@ public class TheMovieDbApi {
WrapperMovieList wrapper = mapper.readValue(webpage, WrapperMovieList.class);
return wrapper.getMovieList();
} catch (IOException ex) {
logger.warn("Failed to find list: " + ex.getMessage());
LOG.warn("Failed to find list: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1382,7 +1381,7 @@ public class TheMovieDbApi {
WrapperCompany wrapper = mapper.readValue(webpage, WrapperCompany.class);
return wrapper.getResults();
} catch (IOException ex) {
logger.warn("Failed to find company: " + ex.getMessage());
LOG.warn("Failed to find company: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1412,7 +1411,7 @@ public class TheMovieDbApi {
WrapperKeywords wrapper = mapper.readValue(webpage, WrapperKeywords.class);
return wrapper.getResults();
} catch (IOException ex) {
logger.warn("Failed to find keyword: " + ex.getMessage());
LOG.warn("Failed to find keyword: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1437,7 +1436,7 @@ public class TheMovieDbApi {
try {
return mapper.readValue(webpage, MovieDbList.class);
} catch (IOException ex) {
logger.warn("Failed to get list: " + ex.getMessage());
LOG.warn("Failed to get list: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
}
@@ -1462,7 +1461,7 @@ public class TheMovieDbApi {
try {
return mapper.readValue(webpage, Keyword.class);
} catch (IOException ex) {
logger.warn("Failed to get keyword: " + ex.getMessage());
LOG.warn("Failed to get keyword: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
@@ -1496,7 +1495,7 @@ public class TheMovieDbApi {
WrapperKeywordMovies wrapper = mapper.readValue(webpage, WrapperKeywordMovies.class);
return wrapper.getResults();
} catch (IOException ex) {
logger.warn("Failed to get top rated movies: " + ex.getMessage());
LOG.warn("Failed to get top rated movies: " + ex.getMessage());
throw new MovieDbException(MovieDbExceptionType.MAPPING_FAILED, webpage, ex);
}
@@ -1,115 +1,116 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class AlternativeTitle implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(AlternativeTitle.class);
/*
* Properties
*/
@JsonProperty("iso_3166_1")
private String country;
@JsonProperty("title")
private String title;
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public String getCountry() {
return country;
}
public String getTitle() {
return title;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCountry(String country) {
this.country = country;
}
public void setTitle(String title) {
this.title = title;
}
// </editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final AlternativeTitle other = (AlternativeTitle) obj;
if ((this.country == null) ? (other.country != null) : !this.country.equals(other.country)) {
return false;
}
if ((this.title == null) ? (other.title != null) : !this.title.equals(other.title)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 89 * hash + (this.country != null ? this.country.hashCode() : 0);
hash = 89 * hash + (this.title != null ? this.title.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[AlternativeTitle=");
sb.append("[country=").append(country);
sb.append("],[title=").append(title);
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class AlternativeTitle implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(AlternativeTitle.class);
/*
* Properties
*/
@JsonProperty("iso_3166_1")
private String country;
@JsonProperty("title")
private String title;
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public String getCountry() {
return country;
}
public String getTitle() {
return title;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCountry(String country) {
this.country = country;
}
public void setTitle(String title) {
this.title = title;
}
// </editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final AlternativeTitle other = (AlternativeTitle) obj;
if ((this.country == null) ? (other.country != null) : !this.country.equals(other.country)) {
return false;
}
if ((this.title == null) ? (other.title != null) : !this.title.equals(other.title)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 89 * hash + (this.country != null ? this.country.hashCode() : 0);
hash = 89 * hash + (this.title != null ? this.title.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[AlternativeTitle=");
sb.append("[country=").append(country);
sb.append("],[title=").append(title);
sb.append("]]");
return sb.toString();
}
}
@@ -1,207 +1,208 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
* The artwork type information
*
* @author Stuart
*/
public class Artwork implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(Artwork.class);
/*
* Properties
*/
@JsonProperty("aspect_ratio")
private float aspectRatio;
@JsonProperty("file_path")
private String filePath;
@JsonProperty("height")
private int height;
@JsonProperty("iso_639_1")
private String language;
@JsonProperty("width")
private int width;
@JsonProperty("vote_average")
private float voteAverage;
@JsonProperty("vote_count")
private int voteCount;
@JsonProperty("flag")
private String flag;
private ArtworkType artworkType = ArtworkType.POSTER;
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public ArtworkType getArtworkType() {
return artworkType;
}
public float getAspectRatio() {
return aspectRatio;
}
public String getFilePath() {
return filePath;
}
public int getHeight() {
return height;
}
public String getLanguage() {
return language;
}
public int getWidth() {
return width;
}
public float getVoteAverage() {
return voteAverage;
}
public int getVoteCount() {
return voteCount;
}
public String getFlag() {
return flag;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setArtworkType(ArtworkType artworkType) {
this.artworkType = artworkType;
}
public void setAspectRatio(float aspectRatio) {
this.aspectRatio = aspectRatio;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public void setHeight(int height) {
this.height = height;
}
public void setLanguage(String language) {
this.language = language;
}
public void setWidth(int width) {
this.width = width;
}
public void setVoteAverage(float voteAverage) {
this.voteAverage = voteAverage;
}
public void setVoteCount(int voteCount) {
this.voteCount = voteCount;
}
public void setFlag(String flag) {
this.flag = flag;
}
// </editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Artwork other = (Artwork) obj;
if (Float.floatToIntBits(this.aspectRatio) != Float.floatToIntBits(other.aspectRatio)) {
return false;
}
if ((this.filePath == null) ? (other.filePath != null) : !this.filePath.equals(other.filePath)) {
return false;
}
if (this.height != other.height) {
return false;
}
if ((this.language == null) ? (other.language != null) : !this.language.equals(other.language)) {
return false;
}
if (this.width != other.width) {
return false;
}
if (this.artworkType != other.artworkType) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 71 * hash + Float.floatToIntBits(this.aspectRatio);
hash = 71 * hash + (this.filePath != null ? this.filePath.hashCode() : 0);
hash = 71 * hash + this.height;
hash = 71 * hash + (this.language != null ? this.language.hashCode() : 0);
hash = 71 * hash + this.width;
hash = 71 * hash + (this.artworkType != null ? this.artworkType.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Artwork=");
sb.append("[aspectRatio=").append(aspectRatio);
sb.append("],[filePath=").append(filePath);
sb.append("],[height=").append(height);
sb.append("],[language=").append(language);
sb.append("],[width=").append(width);
sb.append("],[artworkType=").append(artworkType);
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The artwork type information
*
* @author Stuart
*/
public class Artwork implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(Artwork.class);
/*
* Properties
*/
@JsonProperty("aspect_ratio")
private float aspectRatio;
@JsonProperty("file_path")
private String filePath;
@JsonProperty("height")
private int height;
@JsonProperty("iso_639_1")
private String language;
@JsonProperty("width")
private int width;
@JsonProperty("vote_average")
private float voteAverage;
@JsonProperty("vote_count")
private int voteCount;
@JsonProperty("flag")
private String flag;
private ArtworkType artworkType = ArtworkType.POSTER;
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public ArtworkType getArtworkType() {
return artworkType;
}
public float getAspectRatio() {
return aspectRatio;
}
public String getFilePath() {
return filePath;
}
public int getHeight() {
return height;
}
public String getLanguage() {
return language;
}
public int getWidth() {
return width;
}
public float getVoteAverage() {
return voteAverage;
}
public int getVoteCount() {
return voteCount;
}
public String getFlag() {
return flag;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setArtworkType(ArtworkType artworkType) {
this.artworkType = artworkType;
}
public void setAspectRatio(float aspectRatio) {
this.aspectRatio = aspectRatio;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public void setHeight(int height) {
this.height = height;
}
public void setLanguage(String language) {
this.language = language;
}
public void setWidth(int width) {
this.width = width;
}
public void setVoteAverage(float voteAverage) {
this.voteAverage = voteAverage;
}
public void setVoteCount(int voteCount) {
this.voteCount = voteCount;
}
public void setFlag(String flag) {
this.flag = flag;
}
// </editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Artwork other = (Artwork) obj;
if (Float.floatToIntBits(this.aspectRatio) != Float.floatToIntBits(other.aspectRatio)) {
return false;
}
if ((this.filePath == null) ? (other.filePath != null) : !this.filePath.equals(other.filePath)) {
return false;
}
if (this.height != other.height) {
return false;
}
if ((this.language == null) ? (other.language != null) : !this.language.equals(other.language)) {
return false;
}
if (this.width != other.width) {
return false;
}
if (this.artworkType != other.artworkType) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 71 * hash + Float.floatToIntBits(this.aspectRatio);
hash = 71 * hash + (this.filePath != null ? this.filePath.hashCode() : 0);
hash = 71 * hash + this.height;
hash = 71 * hash + (this.language != null ? this.language.hashCode() : 0);
hash = 71 * hash + this.width;
hash = 71 * hash + (this.artworkType != null ? this.artworkType.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Artwork=");
sb.append("[aspectRatio=").append(aspectRatio);
sb.append("],[filePath=").append(filePath);
sb.append("],[height=").append(height);
sb.append("],[language=").append(language);
sb.append("],[width=").append(width);
sb.append("],[artworkType=").append(artworkType);
sb.append("]]");
return sb.toString();
}
}
@@ -21,7 +21,8 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ChangeItem {
@@ -30,7 +31,7 @@ public class ChangeItem {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(MovieChanges.class);
private static final Logger LOG = LoggerFactory.getLogger(MovieChanges.class);
/*
* Properties
*/
@@ -116,6 +117,6 @@ public class ChangeItem {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
LOG.trace(sb.toString());
}
}
@@ -21,7 +21,8 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ChangeValue {
@@ -30,7 +31,7 @@ public class ChangeValue {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(MovieChanges.class);
private static final Logger LOG = LoggerFactory.getLogger(MovieChanges.class);
/*
* Properties
*/
@@ -122,6 +123,6 @@ public class ChangeValue {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
LOG.trace(sb.toString());
}
}
@@ -24,7 +24,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import java.io.Serializable;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
@@ -37,7 +38,7 @@ public class Collection implements Serializable {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(Collection.class);
private static final Logger LOG = LoggerFactory.getLogger(Collection.class);
/*
* Properties
*/
@@ -123,7 +124,7 @@ public class Collection implements Serializable {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
LOG.trace(sb.toString());
}
@Override
@@ -1,123 +1,124 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class CollectionInfo implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(CollectionInfo.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("name")
private String name;
@JsonProperty("poster_path")
private String posterPath;
@JsonProperty("backdrop_path")
private String backdropPath;
@JsonProperty("parts")
private List<Collection> parts = new ArrayList<Collection>();
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public String getBackdropPath() {
return backdropPath;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public List<Collection> getParts() {
return parts;
}
public String getPosterPath() {
return posterPath;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setParts(List<Collection> parts) {
this.parts = parts;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[CollectionInfo=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("],[posterPath=").append(posterPath);
sb.append("],[backdropPath=").append(backdropPath);
sb.append("],[# of parts=").append(parts.size());
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class CollectionInfo implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(CollectionInfo.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("name")
private String name;
@JsonProperty("poster_path")
private String posterPath;
@JsonProperty("backdrop_path")
private String backdropPath;
@JsonProperty("parts")
private List<Collection> parts = new ArrayList<Collection>();
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public String getBackdropPath() {
return backdropPath;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public List<Collection> getParts() {
return parts;
}
public String getPosterPath() {
return posterPath;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setParts(List<Collection> parts) {
this.parts = parts;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[CollectionInfo=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("],[posterPath=").append(posterPath);
sb.append("],[backdropPath=").append(backdropPath);
sb.append("],[# of parts=").append(parts.size());
sb.append("]]");
return sb.toString();
}
}
@@ -22,7 +22,8 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Company information
@@ -33,7 +34,7 @@ public class Company implements Serializable {
private static final long serialVersionUID = 1L;
// Logger
private static final Logger logger = Logger.getLogger(Company.class);
private static final Logger LOG = LoggerFactory.getLogger(Company.class);
private static final String DEFAULT_STRING = "";
// Properties
@JsonProperty("id")
@@ -122,7 +123,7 @@ public class Company implements Serializable {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
LOG.trace(sb.toString());
}
@Override
@@ -1,116 +1,117 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
*
* @author stuart.boston
*/
@JsonRootName("genre")
public class Genre implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(Genre.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("name")
private String name;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getId() {
return id;
}
public String getName() {
return name;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Genre other = (Genre) obj;
if (this.id != other.id) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 53 * hash + this.id;
hash = 53 * hash + (this.name != null ? this.name.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Genre=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
@JsonRootName("genre")
public class Genre implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(Genre.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("name")
private String name;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getId() {
return id;
}
public String getName() {
return name;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Genre other = (Genre) obj;
if (this.id != other.id) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 53 * hash + this.id;
hash = 53 * hash + (this.name != null ? this.name.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Genre=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
}
}
@@ -1,117 +1,118 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
*
* @author stuart.boston
*/
@JsonRootName("keyword")
public class Keyword implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(Keyword.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("name")
private String name;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getId() {
return id;
}
public String getName() {
return name;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Keyword other = (Keyword) obj;
if (this.id != other.id) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 83 * hash + this.id;
hash = 83 * hash + (this.name != null ? this.name.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Keyword=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
@JsonRootName("keyword")
public class Keyword implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(Keyword.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("name")
private String name;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getId() {
return id;
}
public String getName() {
return name;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Keyword other = (Keyword) obj;
if (this.id != other.id) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 83 * hash + this.id;
hash = 83 * hash + (this.name != null ? this.name.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Keyword=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
}
}
@@ -1,145 +1,146 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class KeywordMovie implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(KeywordMovie.class);
/*
* Properties
*/
@JsonProperty("id")
private String id;
@JsonProperty("backdrop_path")
private String backdropPath;
@JsonProperty("original_title")
private String originalTitle;
@JsonProperty("release_date")
private String releaseDate;
@JsonProperty("poster_path")
private String posterPath;
@JsonProperty("title")
private String title;
@JsonProperty("vote_average")
private float voteAverage;
@JsonProperty("vote_count")
private double voteCount;
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getBackdropPath() {
return backdropPath;
}
public String getId() {
return id;
}
public String getOriginalTitle() {
return originalTitle;
}
public String getReleaseDate() {
return releaseDate;
}
public String getPosterPath() {
return posterPath;
}
public String getTitle() {
return title;
}
public float getVoteAverage() {
return voteAverage;
}
public double getVoteCount() {
return voteCount;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}
public void setId(String id) {
this.id = id;
}
public void setOriginalTitle(String originalTitle) {
this.originalTitle = originalTitle;
}
public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
public void setTitle(String title) {
this.title = title;
}
public void setVoteAverage(float voteAverage) {
this.voteAverage = voteAverage;
}
public void setVoteCount(double voteCount) {
this.voteCount = voteCount;
}
// </editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class KeywordMovie implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(KeywordMovie.class);
/*
* Properties
*/
@JsonProperty("id")
private String id;
@JsonProperty("backdrop_path")
private String backdropPath;
@JsonProperty("original_title")
private String originalTitle;
@JsonProperty("release_date")
private String releaseDate;
@JsonProperty("poster_path")
private String posterPath;
@JsonProperty("title")
private String title;
@JsonProperty("vote_average")
private float voteAverage;
@JsonProperty("vote_count")
private double voteCount;
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getBackdropPath() {
return backdropPath;
}
public String getId() {
return id;
}
public String getOriginalTitle() {
return originalTitle;
}
public String getReleaseDate() {
return releaseDate;
}
public String getPosterPath() {
return posterPath;
}
public String getTitle() {
return title;
}
public float getVoteAverage() {
return voteAverage;
}
public double getVoteCount() {
return voteCount;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}
public void setId(String id) {
this.id = id;
}
public void setOriginalTitle(String originalTitle) {
this.originalTitle = originalTitle;
}
public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
public void setTitle(String title) {
this.title = title;
}
public void setVoteAverage(float voteAverage) {
this.voteAverage = voteAverage;
}
public void setVoteCount(double voteCount) {
this.voteCount = voteCount;
}
// </editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
}
@@ -1,116 +1,117 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
*
* @author stuart.boston
*/
@JsonRootName("spoken_language")
public class Language implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(Language.class);
/*
* Properties
*/
@JsonProperty("iso_639_1")
private String isoCode;
@JsonProperty("name")
private String name;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public String getIsoCode() {
return isoCode;
}
public String getName() {
return name;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setIsoCode(String isoCode) {
this.isoCode = isoCode;
}
public void setName(String name) {
this.name = name;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Language other = (Language) obj;
if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 71 * hash + (this.isoCode != null ? this.isoCode.hashCode() : 0);
hash = 71 * hash + (this.name != null ? this.name.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Language=");
sb.append("isoCode=").append(isoCode);
sb.append(", name=").append(name);
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
@JsonRootName("spoken_language")
public class Language implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(Language.class);
/*
* Properties
*/
@JsonProperty("iso_639_1")
private String isoCode;
@JsonProperty("name")
private String name;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public String getIsoCode() {
return isoCode;
}
public String getName() {
return name;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setIsoCode(String isoCode) {
this.isoCode = isoCode;
}
public void setName(String name) {
this.name = name;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Language other = (Language) obj;
if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 71 * hash + (this.isoCode != null ? this.isoCode.hashCode() : 0);
hash = 71 * hash + (this.name != null ? this.name.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Language=");
sb.append("isoCode=").append(isoCode);
sb.append(", name=").append(name);
sb.append("]]");
return sb.toString();
}
}
@@ -1,81 +1,82 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class MovieChanges implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(MovieChanges.class);
/*
* Properties
*/
@JsonProperty("key")
private String key;
@JsonProperty("items")
private List<ChangeItem> items;
//<editor-fold defaultstate="collapsed" desc="Getter Methods">
public String getKey() {
return key;
}
public List<ChangeItem> getItems() {
return items;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter Methods">
public void setKey(String key) {
this.key = key;
}
public void setItems(List<ChangeItem> items) {
this.items = items;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class MovieChanges implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(MovieChanges.class);
/*
* Properties
*/
@JsonProperty("key")
private String key;
@JsonProperty("items")
private List<ChangeItem> items;
//<editor-fold defaultstate="collapsed" desc="Getter Methods">
public String getKey() {
return key;
}
public List<ChangeItem> getItems() {
return items;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter Methods">
public void setKey(String key) {
this.key = key;
}
public void setItems(List<ChangeItem> items) {
this.items = items;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
}
@@ -1,353 +1,354 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import org.apache.log4j.Logger;
/**
* Movie Bean
*
* @author stuart.boston
*/
public class MovieDb implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(MovieDb.class);
/*
* Properties
*/
@JsonProperty("backdrop_path")
private String backdropPath;
@JsonProperty("id")
private int id;
@JsonProperty("original_title")
private String originalTitle;
@JsonProperty("popularity")
private float popularity;
@JsonProperty("poster_path")
private String posterPath;
@JsonProperty("release_date")
private String releaseDate;
@JsonProperty("title")
private String title;
@JsonProperty("adult")
private boolean adult;
@JsonProperty("belongs_to_collection")
private Collection belongsToCollection;
@JsonProperty("budget")
private long budget;
@JsonProperty("genres")
private List<Genre> genres;
@JsonProperty("homepage")
private String homepage;
@JsonProperty("imdb_id")
private String imdbID;
@JsonProperty("overview")
private String overview;
@JsonProperty("production_companies")
private List<ProductionCompany> productionCompanies;
@JsonProperty("production_countries")
private List<ProductionCountry> productionCountries;
@JsonProperty("revenue")
private long revenue;
@JsonProperty("runtime")
private int runtime;
@JsonProperty("spoken_languages")
private List<Language> spokenLanguages;
@JsonProperty("tagline")
private String tagline;
@JsonProperty("vote_average")
private float voteAverage;
@JsonProperty("vote_count")
private int voteCount;
@JsonProperty("status")
private String status;
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public String getBackdropPath() {
return backdropPath;
}
public int getId() {
return id;
}
public String getOriginalTitle() {
return originalTitle;
}
public float getPopularity() {
return popularity;
}
public String getPosterPath() {
return posterPath;
}
public String getReleaseDate() {
return releaseDate;
}
public String getTitle() {
return title;
}
public boolean isAdult() {
return adult;
}
public Collection getBelongsToCollection() {
return belongsToCollection;
}
public long getBudget() {
return budget;
}
public List<Genre> getGenres() {
return genres;
}
public String getHomepage() {
return homepage;
}
public String getImdbID() {
return imdbID;
}
public String getOverview() {
return overview;
}
public List<ProductionCompany> getProductionCompanies() {
return productionCompanies;
}
public List<ProductionCountry> getProductionCountries() {
return productionCountries;
}
public long getRevenue() {
return revenue;
}
public int getRuntime() {
return runtime;
}
public List<Language> getSpokenLanguages() {
return spokenLanguages;
}
public String getTagline() {
return tagline;
}
public float getVoteAverage() {
return voteAverage;
}
public int getVoteCount() {
return voteCount;
}
public String getStatus() {
return status;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}
public void setId(int id) {
this.id = id;
}
public void setOriginalTitle(String originalTitle) {
this.originalTitle = originalTitle;
}
public void setPopularity(float popularity) {
this.popularity = popularity;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
}
public void setTitle(String title) {
this.title = title;
}
public void setAdult(boolean adult) {
this.adult = adult;
}
public void setBelongsToCollection(Collection belongsToCollection) {
this.belongsToCollection = belongsToCollection;
}
public void setBudget(long budget) {
this.budget = budget;
}
public void setGenres(List<Genre> genres) {
this.genres = genres;
}
public void setHomepage(String homepage) {
this.homepage = homepage;
}
public void setImdbID(String imdbID) {
this.imdbID = imdbID;
}
public void setOverview(String overview) {
this.overview = overview;
}
public void setProductionCompanies(List<ProductionCompany> productionCompanies) {
this.productionCompanies = productionCompanies;
}
public void setProductionCountries(List<ProductionCountry> productionCountries) {
this.productionCountries = productionCountries;
}
public void setRevenue(long revenue) {
this.revenue = revenue;
}
public void setRuntime(int runtime) {
this.runtime = runtime;
}
public void setSpokenLanguages(List<Language> spokenLanguages) {
this.spokenLanguages = spokenLanguages;
}
public void setTagline(String tagline) {
this.tagline = tagline;
}
public void setVoteAverage(float voteAverage) {
this.voteAverage = voteAverage;
}
public void setVoteCount(int voteCount) {
this.voteCount = voteCount;
}
public void setStatus(String status) {
this.status = status;
}
// </editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
//<editor-fold defaultstate="collapsed" desc="Equals and HashCode">
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final MovieDb other = (MovieDb) obj;
if (this.id != other.id) {
return false;
}
if ((this.imdbID == null) ? (other.imdbID != null) : !this.imdbID.equals(other.imdbID)) {
return false;
}
if (this.runtime != other.runtime) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 89 * hash + this.id;
hash = 89 * hash + (this.imdbID != null ? this.imdbID.hashCode() : 0);
hash = 89 * hash + this.runtime;
return hash;
}
//</editor-fold>
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[MovieDB=");
sb.append("[backdropPath=").append(backdropPath);
sb.append("],[id=").append(id);
sb.append("],[originalTitle=").append(originalTitle);
sb.append("],[popularity=").append(popularity);
sb.append("],[posterPath=").append(posterPath);
sb.append("],[releaseDate=").append(releaseDate);
sb.append("],[title=").append(title);
sb.append("],[adult=").append(adult);
sb.append("],[belongsToCollection=").append(belongsToCollection);
sb.append("],[budget=").append(budget);
sb.append("],[genres=").append(genres);
sb.append("],[homepage=").append(homepage);
sb.append("],[imdbID=").append(imdbID);
sb.append("],[overview=").append(overview);
sb.append("],[productionCompanies=").append(productionCompanies);
sb.append("],[productionCountries=").append(productionCountries);
sb.append("],[revenue=").append(revenue);
sb.append("],[runtime=").append(runtime);
sb.append("],[spokenLanguages=").append(spokenLanguages);
sb.append("],[tagline=").append(tagline);
sb.append("],[voteAverage=").append(voteAverage);
sb.append("],[voteCount=").append(voteCount);
sb.append("],[status=").append(status);
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Movie Bean
*
* @author stuart.boston
*/
public class MovieDb implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(MovieDb.class);
/*
* Properties
*/
@JsonProperty("backdrop_path")
private String backdropPath;
@JsonProperty("id")
private int id;
@JsonProperty("original_title")
private String originalTitle;
@JsonProperty("popularity")
private float popularity;
@JsonProperty("poster_path")
private String posterPath;
@JsonProperty("release_date")
private String releaseDate;
@JsonProperty("title")
private String title;
@JsonProperty("adult")
private boolean adult;
@JsonProperty("belongs_to_collection")
private Collection belongsToCollection;
@JsonProperty("budget")
private long budget;
@JsonProperty("genres")
private List<Genre> genres;
@JsonProperty("homepage")
private String homepage;
@JsonProperty("imdb_id")
private String imdbID;
@JsonProperty("overview")
private String overview;
@JsonProperty("production_companies")
private List<ProductionCompany> productionCompanies;
@JsonProperty("production_countries")
private List<ProductionCountry> productionCountries;
@JsonProperty("revenue")
private long revenue;
@JsonProperty("runtime")
private int runtime;
@JsonProperty("spoken_languages")
private List<Language> spokenLanguages;
@JsonProperty("tagline")
private String tagline;
@JsonProperty("vote_average")
private float voteAverage;
@JsonProperty("vote_count")
private int voteCount;
@JsonProperty("status")
private String status;
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public String getBackdropPath() {
return backdropPath;
}
public int getId() {
return id;
}
public String getOriginalTitle() {
return originalTitle;
}
public float getPopularity() {
return popularity;
}
public String getPosterPath() {
return posterPath;
}
public String getReleaseDate() {
return releaseDate;
}
public String getTitle() {
return title;
}
public boolean isAdult() {
return adult;
}
public Collection getBelongsToCollection() {
return belongsToCollection;
}
public long getBudget() {
return budget;
}
public List<Genre> getGenres() {
return genres;
}
public String getHomepage() {
return homepage;
}
public String getImdbID() {
return imdbID;
}
public String getOverview() {
return overview;
}
public List<ProductionCompany> getProductionCompanies() {
return productionCompanies;
}
public List<ProductionCountry> getProductionCountries() {
return productionCountries;
}
public long getRevenue() {
return revenue;
}
public int getRuntime() {
return runtime;
}
public List<Language> getSpokenLanguages() {
return spokenLanguages;
}
public String getTagline() {
return tagline;
}
public float getVoteAverage() {
return voteAverage;
}
public int getVoteCount() {
return voteCount;
}
public String getStatus() {
return status;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}
public void setId(int id) {
this.id = id;
}
public void setOriginalTitle(String originalTitle) {
this.originalTitle = originalTitle;
}
public void setPopularity(float popularity) {
this.popularity = popularity;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
}
public void setTitle(String title) {
this.title = title;
}
public void setAdult(boolean adult) {
this.adult = adult;
}
public void setBelongsToCollection(Collection belongsToCollection) {
this.belongsToCollection = belongsToCollection;
}
public void setBudget(long budget) {
this.budget = budget;
}
public void setGenres(List<Genre> genres) {
this.genres = genres;
}
public void setHomepage(String homepage) {
this.homepage = homepage;
}
public void setImdbID(String imdbID) {
this.imdbID = imdbID;
}
public void setOverview(String overview) {
this.overview = overview;
}
public void setProductionCompanies(List<ProductionCompany> productionCompanies) {
this.productionCompanies = productionCompanies;
}
public void setProductionCountries(List<ProductionCountry> productionCountries) {
this.productionCountries = productionCountries;
}
public void setRevenue(long revenue) {
this.revenue = revenue;
}
public void setRuntime(int runtime) {
this.runtime = runtime;
}
public void setSpokenLanguages(List<Language> spokenLanguages) {
this.spokenLanguages = spokenLanguages;
}
public void setTagline(String tagline) {
this.tagline = tagline;
}
public void setVoteAverage(float voteAverage) {
this.voteAverage = voteAverage;
}
public void setVoteCount(int voteCount) {
this.voteCount = voteCount;
}
public void setStatus(String status) {
this.status = status;
}
// </editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
//<editor-fold defaultstate="collapsed" desc="Equals and HashCode">
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final MovieDb other = (MovieDb) obj;
if (this.id != other.id) {
return false;
}
if ((this.imdbID == null) ? (other.imdbID != null) : !this.imdbID.equals(other.imdbID)) {
return false;
}
if (this.runtime != other.runtime) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 89 * hash + this.id;
hash = 89 * hash + (this.imdbID != null ? this.imdbID.hashCode() : 0);
hash = 89 * hash + this.runtime;
return hash;
}
//</editor-fold>
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[MovieDB=");
sb.append("[backdropPath=").append(backdropPath);
sb.append("],[id=").append(id);
sb.append("],[originalTitle=").append(originalTitle);
sb.append("],[popularity=").append(popularity);
sb.append("],[posterPath=").append(posterPath);
sb.append("],[releaseDate=").append(releaseDate);
sb.append("],[title=").append(title);
sb.append("],[adult=").append(adult);
sb.append("],[belongsToCollection=").append(belongsToCollection);
sb.append("],[budget=").append(budget);
sb.append("],[genres=").append(genres);
sb.append("],[homepage=").append(homepage);
sb.append("],[imdbID=").append(imdbID);
sb.append("],[overview=").append(overview);
sb.append("],[productionCompanies=").append(productionCompanies);
sb.append("],[productionCountries=").append(productionCountries);
sb.append("],[revenue=").append(revenue);
sb.append("],[runtime=").append(runtime);
sb.append("],[spokenLanguages=").append(spokenLanguages);
sb.append("],[tagline=").append(tagline);
sb.append("],[voteAverage=").append(voteAverage);
sb.append("],[voteCount=").append(voteCount);
sb.append("],[status=").append(status);
sb.append("]]");
return sb.toString();
}
}
@@ -23,7 +23,8 @@ import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Collections;
import java.util.List;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Wrapper for the MovieDbList function
@@ -34,7 +35,7 @@ public class MovieDbList {
* Logger
*/
private static final Logger logger = Logger.getLogger(MovieDbList.class);
private static final Logger LOG = LoggerFactory.getLogger(MovieDbList.class);
/*
* Properties
*/
@@ -144,7 +145,7 @@ public class MovieDbList {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
LOG.trace(sb.toString());
}
}
@@ -1,145 +1,146 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class MovieList implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(MovieList.class);
/*
* Properties
*/
@JsonProperty("description")
private String description;
@JsonProperty("favorite_count")
private int favoriteCount;
@JsonProperty("id")
private String id;
@JsonProperty("item_count")
private int itemCount;
@JsonProperty("iso_639_1")
private String language;
@JsonProperty("name")
private String name;
@JsonProperty("poster_path")
private String posterPath;
@JsonProperty("list_type")
private String listType;
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public String getDescription() {
return description;
}
public int getFavoriteCount() {
return favoriteCount;
}
public String getId() {
return id;
}
public int getItemCount() {
return itemCount;
}
public String getLanguage() {
return language;
}
public String getName() {
return name;
}
public String getPosterPath() {
return posterPath;
}
public String getListType() {
return listType;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setDescription(String description) {
this.description = description;
}
public void setFavoriteCount(int favoriteCount) {
this.favoriteCount = favoriteCount;
}
public void setId(String id) {
this.id = id;
}
public void setItemCount(int itemCount) {
this.itemCount = itemCount;
}
public void setLanguage(String language) {
this.language = language;
}
public void setName(String name) {
this.name = name;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
public void setListType(String listType) {
this.listType = listType;
}
// </editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public String toString() {
return "MovieList{" + "description=" + description + ", favoriteCount=" + favoriteCount + ", id=" + id + ", itemCount=" + itemCount + ", language=" + language + ", name=" + name + ", posterPath=" + posterPath + '}';
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class MovieList implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(MovieList.class);
/*
* Properties
*/
@JsonProperty("description")
private String description;
@JsonProperty("favorite_count")
private int favoriteCount;
@JsonProperty("id")
private String id;
@JsonProperty("item_count")
private int itemCount;
@JsonProperty("iso_639_1")
private String language;
@JsonProperty("name")
private String name;
@JsonProperty("poster_path")
private String posterPath;
@JsonProperty("list_type")
private String listType;
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public String getDescription() {
return description;
}
public int getFavoriteCount() {
return favoriteCount;
}
public String getId() {
return id;
}
public int getItemCount() {
return itemCount;
}
public String getLanguage() {
return language;
}
public String getName() {
return name;
}
public String getPosterPath() {
return posterPath;
}
public String getListType() {
return listType;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setDescription(String description) {
this.description = description;
}
public void setFavoriteCount(int favoriteCount) {
this.favoriteCount = favoriteCount;
}
public void setId(String id) {
this.id = id;
}
public void setItemCount(int itemCount) {
this.itemCount = itemCount;
}
public void setLanguage(String language) {
this.language = language;
}
public void setName(String name) {
this.name = name;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
public void setListType(String listType) {
this.listType = listType;
}
// </editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public String toString() {
return "MovieList{" + "description=" + description + ", favoriteCount=" + favoriteCount + ", id=" + id + ", itemCount=" + itemCount + ", language=" + language + ", name=" + name + ", posterPath=" + posterPath + '}';
}
}
@@ -1,322 +1,323 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author stuart.boston
*/
public class Person implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(Person.class);
/*
* Static fields for default cast information
*/
private static final String CAST_DEPARTMENT = "acting";
private static final String CAST_JOB = "actor";
private static final String DEFAULT_STRING = "";
/*
* Properties
*/
@JsonProperty("id")
private int id = -1;
@JsonProperty("name")
private String name = "";
@JsonProperty("profile_path")
private String profilePath = DEFAULT_STRING;
private PersonType personType = PersonType.PERSON;
private String department = DEFAULT_STRING; // Crew
private String job = DEFAULT_STRING; // Crew
private String character = DEFAULT_STRING; // Cast
private int order = -1; // Cast
@JsonProperty("adult")
private boolean adult = false; // Person info
@JsonProperty("also_known_as")
private List<String> aka = new ArrayList<String>();
@JsonProperty("biography")
private String biography = DEFAULT_STRING;
@JsonProperty("birthday")
private String birthday = DEFAULT_STRING;
@JsonProperty("deathday")
private String deathday = DEFAULT_STRING;
@JsonProperty("homepage")
private String homepage = DEFAULT_STRING;
@JsonProperty("place_of_birth")
private String birthplace = DEFAULT_STRING;
/**
* Add a crew member
*
* @param id
* @param name
* @param profilePath
* @param department
* @param job
*/
public void addCrew(int id, String name, String profilePath, String department, String job) {
this.personType = PersonType.CREW;
this.id = id;
this.name = name;
this.profilePath = profilePath;
this.department = department;
this.job = job;
this.character = "";
this.order = -1;
}
/**
* Add a cast member
*
* @param id
* @param name
* @param profilePath
* @param character
* @param order
*/
public void addCast(int id, String name, String profilePath, String character, int order) {
this.personType = PersonType.CAST;
this.id = id;
this.name = name;
this.profilePath = profilePath;
this.character = character;
this.order = order;
this.department = CAST_DEPARTMENT;
this.job = CAST_JOB;
}
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public String getCharacter() {
return character;
}
public String getDepartment() {
return department;
}
public int getId() {
return id;
}
public String getJob() {
return job;
}
public String getName() {
return name;
}
public int getOrder() {
return order;
}
public PersonType getPersonType() {
return personType;
}
public String getProfilePath() {
return profilePath;
}
public boolean isAdult() {
return adult;
}
public List<String> getAka() {
return aka;
}
public String getBiography() {
return biography;
}
public String getBirthday() {
return birthday;
}
public String getBirthplace() {
return birthplace;
}
public String getDeathday() {
return deathday;
}
public String getHomepage() {
return homepage;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCharacter(String character) {
this.character = character;
}
public void setDepartment(String department) {
this.department = department;
}
public void setId(int id) {
this.id = id;
}
public void setJob(String job) {
this.job = job;
}
public void setName(String name) {
this.name = name;
}
public void setOrder(int order) {
this.order = order;
}
public void setPersonType(PersonType personType) {
this.personType = personType;
}
public void setProfilePath(String profilePath) {
this.profilePath = profilePath;
}
public void setAdult(boolean adult) {
this.adult = adult;
}
public void setAka(List<String> aka) {
this.aka = aka;
}
public void setBiography(String biography) {
this.biography = biography;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public void setBirthplace(String birthplace) {
this.birthplace = birthplace;
}
public void setDeathday(String deathday) {
this.deathday = deathday;
}
public void setHomepage(String homepage) {
this.homepage = homepage;
}
// </editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Person other = (Person) obj;
if (this.id != other.id) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
if ((this.profilePath == null) ? (other.profilePath != null) : !this.profilePath.equals(other.profilePath)) {
return false;
}
if (this.personType != other.personType) {
return false;
}
if ((this.department == null) ? (other.department != null) : !this.department.equals(other.department)) {
return false;
}
if ((this.job == null) ? (other.job != null) : !this.job.equals(other.job)) {
return false;
}
if ((this.character == null) ? (other.character != null) : !this.character.equals(other.character)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 37 * hash + this.id;
hash = 37 * hash + (this.name != null ? this.name.hashCode() : 0);
hash = 37 * hash + (this.profilePath != null ? this.profilePath.hashCode() : 0);
hash = 37 * hash + (this.personType != null ? this.personType.hashCode() : 0);
hash = 37 * hash + (this.department != null ? this.department.hashCode() : 0);
hash = 37 * hash + (this.job != null ? this.job.hashCode() : 0);
hash = 37 * hash + (this.character != null ? this.character.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Person=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("],[profilePath=").append(profilePath);
sb.append("],[personType=").append(personType);
sb.append("],[department=").append(department);
sb.append("],[job=").append(job);
sb.append("],[character=").append(character);
sb.append("],[order=").append(order);
sb.append("],[adult=").append(adult);
sb.append("],[=aka").append(aka.toString());
sb.append("],[biography=").append(biography);
sb.append("],[birthday=").append(birthday);
sb.append("],[deathday=").append(deathday);
sb.append("],[homepage=").append(homepage);
sb.append("],[birthplace=").append(birthplace);
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
public class Person implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(Person.class);
/*
* Static fields for default cast information
*/
private static final String CAST_DEPARTMENT = "acting";
private static final String CAST_JOB = "actor";
private static final String DEFAULT_STRING = "";
/*
* Properties
*/
@JsonProperty("id")
private int id = -1;
@JsonProperty("name")
private String name = "";
@JsonProperty("profile_path")
private String profilePath = DEFAULT_STRING;
private PersonType personType = PersonType.PERSON;
private String department = DEFAULT_STRING; // Crew
private String job = DEFAULT_STRING; // Crew
private String character = DEFAULT_STRING; // Cast
private int order = -1; // Cast
@JsonProperty("adult")
private boolean adult = false; // Person info
@JsonProperty("also_known_as")
private List<String> aka = new ArrayList<String>();
@JsonProperty("biography")
private String biography = DEFAULT_STRING;
@JsonProperty("birthday")
private String birthday = DEFAULT_STRING;
@JsonProperty("deathday")
private String deathday = DEFAULT_STRING;
@JsonProperty("homepage")
private String homepage = DEFAULT_STRING;
@JsonProperty("place_of_birth")
private String birthplace = DEFAULT_STRING;
/**
* Add a crew member
*
* @param id
* @param name
* @param profilePath
* @param department
* @param job
*/
public void addCrew(int id, String name, String profilePath, String department, String job) {
this.personType = PersonType.CREW;
this.id = id;
this.name = name;
this.profilePath = profilePath;
this.department = department;
this.job = job;
this.character = "";
this.order = -1;
}
/**
* Add a cast member
*
* @param id
* @param name
* @param profilePath
* @param character
* @param order
*/
public void addCast(int id, String name, String profilePath, String character, int order) {
this.personType = PersonType.CAST;
this.id = id;
this.name = name;
this.profilePath = profilePath;
this.character = character;
this.order = order;
this.department = CAST_DEPARTMENT;
this.job = CAST_JOB;
}
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public String getCharacter() {
return character;
}
public String getDepartment() {
return department;
}
public int getId() {
return id;
}
public String getJob() {
return job;
}
public String getName() {
return name;
}
public int getOrder() {
return order;
}
public PersonType getPersonType() {
return personType;
}
public String getProfilePath() {
return profilePath;
}
public boolean isAdult() {
return adult;
}
public List<String> getAka() {
return aka;
}
public String getBiography() {
return biography;
}
public String getBirthday() {
return birthday;
}
public String getBirthplace() {
return birthplace;
}
public String getDeathday() {
return deathday;
}
public String getHomepage() {
return homepage;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCharacter(String character) {
this.character = character;
}
public void setDepartment(String department) {
this.department = department;
}
public void setId(int id) {
this.id = id;
}
public void setJob(String job) {
this.job = job;
}
public void setName(String name) {
this.name = name;
}
public void setOrder(int order) {
this.order = order;
}
public void setPersonType(PersonType personType) {
this.personType = personType;
}
public void setProfilePath(String profilePath) {
this.profilePath = profilePath;
}
public void setAdult(boolean adult) {
this.adult = adult;
}
public void setAka(List<String> aka) {
this.aka = aka;
}
public void setBiography(String biography) {
this.biography = biography;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public void setBirthplace(String birthplace) {
this.birthplace = birthplace;
}
public void setDeathday(String deathday) {
this.deathday = deathday;
}
public void setHomepage(String homepage) {
this.homepage = homepage;
}
// </editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Person other = (Person) obj;
if (this.id != other.id) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
if ((this.profilePath == null) ? (other.profilePath != null) : !this.profilePath.equals(other.profilePath)) {
return false;
}
if (this.personType != other.personType) {
return false;
}
if ((this.department == null) ? (other.department != null) : !this.department.equals(other.department)) {
return false;
}
if ((this.job == null) ? (other.job != null) : !this.job.equals(other.job)) {
return false;
}
if ((this.character == null) ? (other.character != null) : !this.character.equals(other.character)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 37 * hash + this.id;
hash = 37 * hash + (this.name != null ? this.name.hashCode() : 0);
hash = 37 * hash + (this.profilePath != null ? this.profilePath.hashCode() : 0);
hash = 37 * hash + (this.personType != null ? this.personType.hashCode() : 0);
hash = 37 * hash + (this.department != null ? this.department.hashCode() : 0);
hash = 37 * hash + (this.job != null ? this.job.hashCode() : 0);
hash = 37 * hash + (this.character != null ? this.character.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Person=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("],[profilePath=").append(profilePath);
sb.append("],[personType=").append(personType);
sb.append("],[department=").append(department);
sb.append("],[job=").append(job);
sb.append("],[character=").append(character);
sb.append("],[order=").append(order);
sb.append("],[adult=").append(adult);
sb.append("],[=aka").append(aka.toString());
sb.append("],[biography=").append(biography);
sb.append("],[birthday=").append(birthday);
sb.append("],[deathday=").append(deathday);
sb.append("],[homepage=").append(homepage);
sb.append("],[birthplace=").append(birthplace);
sb.append("]]");
return sb.toString();
}
}
@@ -1,172 +1,173 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class PersonCast implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(PersonCast.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("character")
private String character;
@JsonProperty("name")
private String name;
@JsonProperty("order")
private int order;
@JsonProperty("profile_path")
private String profilePath;
@JsonProperty("cast_id")
private int castId;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public String getCharacter() {
return character;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public int getOrder() {
return order;
}
public String getProfilePath() {
return profilePath;
}
public int getCastId() {
return castId;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCharacter(String character) {
this.character = character;
}
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setOrder(int order) {
this.order = order;
}
public void setProfilePath(String profilePath) {
this.profilePath = profilePath;
}
public void setCastId(int castId) {
this.castId = castId;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final PersonCast other = (PersonCast) obj;
if (this.id != other.id) {
return false;
}
if ((this.character == null) ? (other.character != null) : !this.character.equals(other.character)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
if (this.order != other.order) {
return false;
}
if ((this.profilePath == null) ? (other.profilePath != null) : !this.profilePath.equals(other.profilePath)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 41 * hash + this.id;
hash = 41 * hash + (this.character != null ? this.character.hashCode() : 0);
hash = 41 * hash + (this.name != null ? this.name.hashCode() : 0);
hash = 41 * hash + this.order;
hash = 41 * hash + (this.profilePath != null ? this.profilePath.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[PersonCast=");
sb.append("id=").append(id);
sb.append("],[character=").append(character);
sb.append("],[name=").append(name);
sb.append("],[order=").append(order);
sb.append("],[profilePath=").append(profilePath);
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class PersonCast implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(PersonCast.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("character")
private String character;
@JsonProperty("name")
private String name;
@JsonProperty("order")
private int order;
@JsonProperty("profile_path")
private String profilePath;
@JsonProperty("cast_id")
private int castId;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public String getCharacter() {
return character;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public int getOrder() {
return order;
}
public String getProfilePath() {
return profilePath;
}
public int getCastId() {
return castId;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCharacter(String character) {
this.character = character;
}
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setOrder(int order) {
this.order = order;
}
public void setProfilePath(String profilePath) {
this.profilePath = profilePath;
}
public void setCastId(int castId) {
this.castId = castId;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final PersonCast other = (PersonCast) obj;
if (this.id != other.id) {
return false;
}
if ((this.character == null) ? (other.character != null) : !this.character.equals(other.character)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
if (this.order != other.order) {
return false;
}
if ((this.profilePath == null) ? (other.profilePath != null) : !this.profilePath.equals(other.profilePath)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 41 * hash + this.id;
hash = 41 * hash + (this.character != null ? this.character.hashCode() : 0);
hash = 41 * hash + (this.name != null ? this.name.hashCode() : 0);
hash = 41 * hash + this.order;
hash = 41 * hash + (this.profilePath != null ? this.profilePath.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[PersonCast=");
sb.append("id=").append(id);
sb.append("],[character=").append(character);
sb.append("],[name=").append(name);
sb.append("],[order=").append(order);
sb.append("],[profilePath=").append(profilePath);
sb.append("]]");
return sb.toString();
}
}
@@ -22,7 +22,8 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
@@ -35,7 +36,7 @@ public class PersonCredit implements Serializable {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(PersonCredit.class);
private static final Logger LOG = LoggerFactory.getLogger(PersonCredit.class);
private static final String DEFAULT_STRING = "";
/*
* Properties
@@ -155,7 +156,7 @@ public class PersonCredit implements Serializable {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
LOG.trace(sb.toString());
}
@Override
@@ -22,7 +22,8 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
@@ -35,7 +36,7 @@ public class PersonCrew implements Serializable {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(PersonCrew.class);
private static final Logger LOG = LoggerFactory.getLogger(PersonCrew.class);
/*
* Properties
*/
@@ -105,7 +106,7 @@ public class PersonCrew implements Serializable {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
LOG.trace(sb.toString());
}
@Override
@@ -1,117 +1,118 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
*
* @author stuart.boston
*/
@JsonRootName("production_company")
public class ProductionCompany implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(ProductionCompany.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("name")
private String name;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getId() {
return id;
}
public String getName() {
return name;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ProductionCompany other = (ProductionCompany) obj;
if (this.id != other.id) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 37 * hash + this.id;
hash = 37 * hash + (this.name != null ? this.name.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ProductionCompany=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
@JsonRootName("production_company")
public class ProductionCompany implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(ProductionCompany.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("name")
private String name;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getId() {
return id;
}
public String getName() {
return name;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ProductionCompany other = (ProductionCompany) obj;
if (this.id != other.id) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 37 * hash + this.id;
hash = 37 * hash + (this.name != null ? this.name.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ProductionCompany=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
}
}
@@ -1,117 +1,118 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
*
* @author stuart.boston
*/
@JsonRootName("production_country")
public class ProductionCountry implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(ProductionCountry.class);
/*
* Properties
*/
@JsonProperty("iso_3166_1")
private String isoCode;
@JsonProperty("name")
private String name;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public String getIsoCode() {
return isoCode;
}
public String getName() {
return name;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setIsoCode(String isoCode) {
this.isoCode = isoCode;
}
public void setName(String name) {
this.name = name;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ProductionCountry other = (ProductionCountry) obj;
if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 47 * hash + (this.isoCode != null ? this.isoCode.hashCode() : 0);
hash = 47 * hash + (this.name != null ? this.name.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ProductionCountry=");
sb.append("[isoCode=").append(isoCode);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
@JsonRootName("production_country")
public class ProductionCountry implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(ProductionCountry.class);
/*
* Properties
*/
@JsonProperty("iso_3166_1")
private String isoCode;
@JsonProperty("name")
private String name;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public String getIsoCode() {
return isoCode;
}
public String getName() {
return name;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setIsoCode(String isoCode) {
this.isoCode = isoCode;
}
public void setName(String name) {
this.name = name;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ProductionCountry other = (ProductionCountry) obj;
if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 47 * hash + (this.isoCode != null ? this.isoCode.hashCode() : 0);
hash = 47 * hash + (this.name != null ? this.name.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ProductionCountry=");
sb.append("[isoCode=").append(isoCode);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
}
}
@@ -1,130 +1,131 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class ReleaseInfo implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(ReleaseInfo.class);
/*
* Properties
*/
@JsonProperty("iso_3166_1")
private String country;
@JsonProperty("certification")
private String certification;
@JsonProperty("release_date")
private String releaseDate;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public String getCertification() {
return certification;
}
public String getCountry() {
return country;
}
public String getReleaseDate() {
return releaseDate;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCertification(String certification) {
this.certification = certification;
}
public void setCountry(String country) {
this.country = country;
}
public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ReleaseInfo other = (ReleaseInfo) obj;
if ((this.country == null) ? (other.country != null) : !this.country.equals(other.country)) {
return false;
}
if ((this.certification == null) ? (other.certification != null) : !this.certification.equals(other.certification)) {
return false;
}
if ((this.releaseDate == null) ? (other.releaseDate != null) : !this.releaseDate.equals(other.releaseDate)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 89 * hash + (this.country != null ? this.country.hashCode() : 0);
hash = 89 * hash + (this.certification != null ? this.certification.hashCode() : 0);
hash = 89 * hash + (this.releaseDate != null ? this.releaseDate.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ReleaseInfo=");
sb.append("[country=").append(country);
sb.append("],[certification=").append(certification);
sb.append("],[releaseDate=").append(releaseDate);
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class ReleaseInfo implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(ReleaseInfo.class);
/*
* Properties
*/
@JsonProperty("iso_3166_1")
private String country;
@JsonProperty("certification")
private String certification;
@JsonProperty("release_date")
private String releaseDate;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public String getCertification() {
return certification;
}
public String getCountry() {
return country;
}
public String getReleaseDate() {
return releaseDate;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCertification(String certification) {
this.certification = certification;
}
public void setCountry(String country) {
this.country = country;
}
public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ReleaseInfo other = (ReleaseInfo) obj;
if ((this.country == null) ? (other.country != null) : !this.country.equals(other.country)) {
return false;
}
if ((this.certification == null) ? (other.certification != null) : !this.certification.equals(other.certification)) {
return false;
}
if ((this.releaseDate == null) ? (other.releaseDate != null) : !this.releaseDate.equals(other.releaseDate)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 89 * hash + (this.country != null ? this.country.hashCode() : 0);
hash = 89 * hash + (this.certification != null ? this.certification.hashCode() : 0);
hash = 89 * hash + (this.releaseDate != null ? this.releaseDate.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ReleaseInfo=");
sb.append("[country=").append(country);
sb.append("],[certification=").append(certification);
sb.append("],[releaseDate=").append(releaseDate);
sb.append("]]");
return sb.toString();
}
}
@@ -1,88 +1,89 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class StatusCode implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(StatusCode.class);
/*
* Properties
*/
@JsonProperty("status_code")
private int statusCode;
@JsonProperty("status_message")
private String statusMessage;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getStatusCode() {
return statusCode;
}
public void setStatusCode(int statusCode) {
this.statusCode = statusCode;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public String getStatusMessage() {
return statusMessage;
}
public void setStatusMessage(String statusMessage) {
this.statusMessage = statusMessage;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Status Code: ").append(statusCode);
sb.append(", Message: ").append(statusMessage);
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class StatusCode implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(StatusCode.class);
/*
* Properties
*/
@JsonProperty("status_code")
private int statusCode;
@JsonProperty("status_message")
private String statusMessage;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getStatusCode() {
return statusCode;
}
public void setStatusCode(int statusCode) {
this.statusCode = statusCode;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public String getStatusMessage() {
return statusMessage;
}
public void setStatusMessage(String statusMessage) {
this.statusMessage = statusMessage;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Status Code: ").append(statusCode);
sb.append(", Message: ").append(statusMessage);
return sb.toString();
}
}
@@ -1,206 +1,207 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
/**
*
* @author stuart.boston
*/
public class TmdbConfiguration implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(TmdbConfiguration.class);
/*
* Properties
*/
@JsonProperty("base_url")
private String baseUrl;
@JsonProperty("secure_base_url")
private String secureBaseUrl;
@JsonProperty("poster_sizes")
private List<String> posterSizes;
@JsonProperty("backdrop_sizes")
private List<String> backdropSizes;
@JsonProperty("profile_sizes")
private List<String> profileSizes;
@JsonProperty("logo_sizes")
private List<String> logoSizes;
// <editor-fold defaultstate="collapsed" desc="Getter methods">//GEN-BEGIN:getterMethods
public List<String> getBackdropSizes() {
return backdropSizes;
}
public String getBaseUrl() {
return baseUrl;
}
public List<String> getPosterSizes() {
return posterSizes;
}
public List<String> getProfileSizes() {
return profileSizes;
}
public List<String> getLogoSizes() {
return logoSizes;
}
public String getSecureBaseUrl() {
return secureBaseUrl;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">//GEN-BEGIN:setterMethods
public void setBackdropSizes(List<String> backdropSizes) {
this.backdropSizes = backdropSizes;
}
public void setBaseUrl(String baseUrl) {
this.baseUrl = baseUrl;
}
public void setPosterSizes(List<String> posterSizes) {
this.posterSizes = posterSizes;
}
public void setProfileSizes(List<String> profileSizes) {
this.profileSizes = profileSizes;
}
public void setLogoSizes(List<String> logoSizes) {
this.logoSizes = logoSizes;
}
public void setSecureBaseUrl(String secureBaseUrl) {
this.secureBaseUrl = secureBaseUrl;
}
// </editor-fold>
/**
* Copy the data from the passed object to this one
*
* @param config
*/
public void clone(TmdbConfiguration config) {
backdropSizes = config.getBackdropSizes();
baseUrl = config.getBaseUrl();
posterSizes = config.getPosterSizes();
profileSizes = config.getProfileSizes();
logoSizes = config.getLogoSizes();
}
/**
* Check that the poster size is valid
*
* @param posterSize
*/
public boolean isValidPosterSize(String posterSize) {
if (StringUtils.isBlank(posterSize) || posterSizes.isEmpty()) {
return false;
}
return posterSizes.contains(posterSize);
}
/**
* Check that the backdrop size is valid
*
* @param backdropSize
*/
public boolean isValidBackdropSize(String backdropSize) {
if (StringUtils.isBlank(backdropSize) || backdropSizes.isEmpty()) {
return false;
}
return backdropSizes.contains(backdropSize);
}
/**
* Check that the profile size is valid
*
* @param profileSize
*/
public boolean isValidProfileSize(String profileSize) {
if (StringUtils.isBlank(profileSize) || profileSizes.isEmpty()) {
return false;
}
return profileSizes.contains(profileSize);
}
/**
* Check that the logo size is valid
*
* @param logoSize
*/
public boolean isValidLogoSize(String logoSize) {
if (StringUtils.isBlank(logoSize) || logoSizes.isEmpty()) {
return false;
}
return logoSizes.contains(logoSize);
}
/**
* Check to see if the size is valid for any of the images types
*
* @param sizeToCheck
*/
public boolean isValidSize(String sizeToCheck) {
return (isValidPosterSize(sizeToCheck)
|| isValidBackdropSize(sizeToCheck)
|| isValidProfileSize(sizeToCheck)
|| isValidLogoSize(sizeToCheck));
}
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ImageConfiguration=");
sb.append("[baseUrl=").append(baseUrl);
sb.append("],[posterSizes=").append(posterSizes.toString());
sb.append("],[backdropSizes=").append(backdropSizes.toString());
sb.append("],[profileSizes=").append(profileSizes.toString());
sb.append("],[logoSizes=").append(logoSizes.toString());
sb.append(("]]"));
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
public class TmdbConfiguration implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(TmdbConfiguration.class);
/*
* Properties
*/
@JsonProperty("base_url")
private String baseUrl;
@JsonProperty("secure_base_url")
private String secureBaseUrl;
@JsonProperty("poster_sizes")
private List<String> posterSizes;
@JsonProperty("backdrop_sizes")
private List<String> backdropSizes;
@JsonProperty("profile_sizes")
private List<String> profileSizes;
@JsonProperty("logo_sizes")
private List<String> logoSizes;
// <editor-fold defaultstate="collapsed" desc="Getter methods">//GEN-BEGIN:getterMethods
public List<String> getBackdropSizes() {
return backdropSizes;
}
public String getBaseUrl() {
return baseUrl;
}
public List<String> getPosterSizes() {
return posterSizes;
}
public List<String> getProfileSizes() {
return profileSizes;
}
public List<String> getLogoSizes() {
return logoSizes;
}
public String getSecureBaseUrl() {
return secureBaseUrl;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">//GEN-BEGIN:setterMethods
public void setBackdropSizes(List<String> backdropSizes) {
this.backdropSizes = backdropSizes;
}
public void setBaseUrl(String baseUrl) {
this.baseUrl = baseUrl;
}
public void setPosterSizes(List<String> posterSizes) {
this.posterSizes = posterSizes;
}
public void setProfileSizes(List<String> profileSizes) {
this.profileSizes = profileSizes;
}
public void setLogoSizes(List<String> logoSizes) {
this.logoSizes = logoSizes;
}
public void setSecureBaseUrl(String secureBaseUrl) {
this.secureBaseUrl = secureBaseUrl;
}
// </editor-fold>
/**
* Copy the data from the passed object to this one
*
* @param config
*/
public void clone(TmdbConfiguration config) {
backdropSizes = config.getBackdropSizes();
baseUrl = config.getBaseUrl();
posterSizes = config.getPosterSizes();
profileSizes = config.getProfileSizes();
logoSizes = config.getLogoSizes();
}
/**
* Check that the poster size is valid
*
* @param posterSize
*/
public boolean isValidPosterSize(String posterSize) {
if (StringUtils.isBlank(posterSize) || posterSizes.isEmpty()) {
return false;
}
return posterSizes.contains(posterSize);
}
/**
* Check that the backdrop size is valid
*
* @param backdropSize
*/
public boolean isValidBackdropSize(String backdropSize) {
if (StringUtils.isBlank(backdropSize) || backdropSizes.isEmpty()) {
return false;
}
return backdropSizes.contains(backdropSize);
}
/**
* Check that the profile size is valid
*
* @param profileSize
*/
public boolean isValidProfileSize(String profileSize) {
if (StringUtils.isBlank(profileSize) || profileSizes.isEmpty()) {
return false;
}
return profileSizes.contains(profileSize);
}
/**
* Check that the logo size is valid
*
* @param logoSize
*/
public boolean isValidLogoSize(String logoSize) {
if (StringUtils.isBlank(logoSize) || logoSizes.isEmpty()) {
return false;
}
return logoSizes.contains(logoSize);
}
/**
* Check to see if the size is valid for any of the images types
*
* @param sizeToCheck
*/
public boolean isValidSize(String sizeToCheck) {
return (isValidPosterSize(sizeToCheck)
|| isValidBackdropSize(sizeToCheck)
|| isValidProfileSize(sizeToCheck)
|| isValidLogoSize(sizeToCheck));
}
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ImageConfiguration=");
sb.append("[baseUrl=").append(baseUrl);
sb.append("],[posterSizes=").append(posterSizes.toString());
sb.append("],[backdropSizes=").append(backdropSizes.toString());
sb.append("],[profileSizes=").append(profileSizes.toString());
sb.append("],[logoSizes=").append(logoSizes.toString());
sb.append(("]]"));
return sb.toString();
}
}
@@ -21,13 +21,14 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TokenAuthorisation {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(TokenAuthorisation.class);
private static final Logger LOG = LoggerFactory.getLogger(TokenAuthorisation.class);
/*
* Properties
*/
@@ -77,7 +78,7 @@ public class TokenAuthorisation {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
LOG.trace(sb.toString());
}
@Override
@@ -21,14 +21,15 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TokenSession {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(TokenSession.class);
private static final Logger LOG = LoggerFactory.getLogger(TokenSession.class);
/*
* Properties
*/
@@ -109,7 +110,7 @@ public class TokenSession {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
LOG.trace(sb.toString());
}
@Override
@@ -21,7 +21,8 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import java.io.Serializable;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
@@ -34,7 +35,7 @@ public class Trailer implements Serializable {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(Trailer.class);
private static final Logger LOG = LoggerFactory.getLogger(Trailer.class);
/*
* Website sources
*/
@@ -95,7 +96,7 @@ public class Trailer implements Serializable {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
LOG.trace(sb.toString());
}
@Override
@@ -1,130 +1,131 @@
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class Translation implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(Translation.class);
/*
* Properties
*/
@JsonProperty("english_name")
private String englishName;
@JsonProperty("iso_639_1")
private String isoCode;
@JsonProperty("name")
private String name;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public String getEnglishName() {
return englishName;
}
public String getIsoCode() {
return isoCode;
}
public String getName() {
return name;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setEnglishName(String englishName) {
this.englishName = englishName;
}
public void setIsoCode(String isoCode) {
this.isoCode = isoCode;
}
public void setName(String name) {
this.name = name;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Translation other = (Translation) obj;
if ((this.englishName == null) ? (other.englishName != null) : !this.englishName.equals(other.englishName)) {
return false;
}
if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 29 * hash + (this.englishName != null ? this.englishName.hashCode() : 0);
hash = 29 * hash + (this.isoCode != null ? this.isoCode.hashCode() : 0);
hash = 29 * hash + (this.name != null ? this.name.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Translation=");
sb.append("[englishName=").append(englishName);
sb.append("],[isoCode=").append(isoCode);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class Translation implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(Translation.class);
/*
* Properties
*/
@JsonProperty("english_name")
private String englishName;
@JsonProperty("iso_639_1")
private String isoCode;
@JsonProperty("name")
private String name;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public String getEnglishName() {
return englishName;
}
public String getIsoCode() {
return isoCode;
}
public String getName() {
return name;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setEnglishName(String englishName) {
this.englishName = englishName;
}
public void setIsoCode(String isoCode) {
this.isoCode = isoCode;
}
public void setName(String name) {
this.name = name;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Translation other = (Translation) obj;
if ((this.englishName == null) ? (other.englishName != null) : !this.englishName.equals(other.englishName)) {
return false;
}
if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 29 * hash + (this.englishName != null ? this.englishName.hashCode() : 0);
hash = 29 * hash + (this.isoCode != null ? this.isoCode.hashCode() : 0);
hash = 29 * hash + (this.name != null ? this.name.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Translation=");
sb.append("[englishName=").append(englishName);
sb.append("],[isoCode=").append(isoCode);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
}
}
@@ -26,7 +26,8 @@ import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The API URL that is used to construct the API call
@@ -38,7 +39,7 @@ public class ApiUrl {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(ApiUrl.class);
private static final Logger LOG = LoggerFactory.getLogger(ApiUrl.class);
/*
* TheMovieDbApi API Base URL
*/
@@ -126,7 +127,7 @@ public class ApiUrl {
try {
urlString.append(URLEncoder.encode(query, "UTF-8"));
} catch (UnsupportedEncodingException ex) {
logger.trace("Unable to encode query: '" + query + "' trying raw.");
LOG.trace("Unable to encode query: '" + query + "' trying raw.");
// If we can't encode it, try it raw
urlString.append(query);
}
@@ -153,10 +154,10 @@ public class ApiUrl {
}
try {
logger.trace("URL: " + urlString.toString());
LOG.trace("URL: " + urlString.toString());
return new URL(urlString.toString());
} catch (MalformedURLException ex) {
logger.warn("Failed to create URL " + urlString.toString() + " - " + ex.toString());
LOG.warn("Failed to create URL " + urlString.toString() + " - " + ex.toString());
return null;
} finally {
arguments.clear();
@@ -1,74 +0,0 @@
/*
* Copyright (c) 2004-2013 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.tools;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.spi.LoggingEvent;
/**
* Log4J Filtering routine to remove API keys from the output
*
* @author Stuart.Boston
*
*/
public class FilteringLayout extends PatternLayout {
private static final String REPLACEMENT = "[APIKEY]";
private static Pattern replacementPattern = Pattern.compile("DO_NOT_MATCH");
/**
* Add the string to replace in the log output
*
* @param replacementString
*/
public static void addReplacementString(String replacementString) {
replacementPattern = Pattern.compile(replacementString);
}
/**
* Extend the format to remove the API_KEYS from the output
*
* @param event
*/
@Override
public String format(LoggingEvent event) {
if (event.getMessage() instanceof String) {
String message = event.getRenderedMessage();
Matcher matcher = replacementPattern.matcher(message);
if (matcher.find()) {
String maskedMessage = matcher.replaceAll(REPLACEMENT);
Throwable throwable = event.getThrowableInformation() != null
? event.getThrowableInformation().getThrowable() : null;
LoggingEvent maskedEvent = new LoggingEvent(event.fqnOfCategoryClass,
Logger.getLogger(event.getLoggerName()), event.timeStamp,
event.getLevel(), maskedMessage, throwable);
return super.format(maskedEvent);
}
}
return super.format(event);
}
}
@@ -36,14 +36,15 @@ import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Web browser with simple cookies support
*/
public final class WebBrowser {
private static final Logger logger = Logger.getLogger(WebBrowser.class);
private static final Logger LOG = LoggerFactory.getLogger(WebBrowser.class);
private static Map<String, String> browserProperties = new HashMap<String, String>();
private static Map<String, Map<String, String>> cookies = new HashMap<String, Map<String, String>>();
private static String proxyHost = null;
@@ -134,7 +135,7 @@ public final class WebBrowser {
try {
content.close();
} catch (IOException ex) {
logger.debug("Failed to close connection: " + ex.getMessage());
LOG.debug("Failed to close connection: " + ex.getMessage());
}
}
}
@@ -1,74 +1,75 @@
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.AlternativeTitle;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class WrapperAlternativeTitles {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(WrapperAlternativeTitles.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("titles")
private List<AlternativeTitle> titles;
public int getId() {
return id;
}
public List<AlternativeTitle> getTitles() {
return titles;
}
public void setId(int id) {
this.id = id;
}
public void setTitles(List<AlternativeTitle> titles) {
this.titles = titles;
}
/**
* Handle unknown properties and print a message
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
}
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.AlternativeTitle;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class WrapperAlternativeTitles {
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(WrapperAlternativeTitles.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("titles")
private List<AlternativeTitle> titles;
public int getId() {
return id;
}
public List<AlternativeTitle> getTitles() {
return titles;
}
public void setId(int id) {
this.id = id;
}
public void setTitles(List<AlternativeTitle> titles) {
this.titles = titles;
}
/**
* Handle unknown properties and print a message
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
}
@@ -1,102 +1,103 @@
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.log4j.Logger;
/**
* Base class for the wrappers
*
* @author Stuart
*/
public class WrapperBase {
/*
* Logger - set but the sub-classes
*/
private Logger logger;
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("page")
private int page;
@JsonProperty("total_pages")
private int totalPages;
@JsonProperty("total_results")
private int totalResults;
public WrapperBase(Logger logger) {
this.logger = logger;
}
//<editor-fold defaultstate="collapsed" desc="Getter Methods">
public int getId() {
return id;
}
public int getPage() {
return page;
}
public int getTotalPages() {
return totalPages;
}
public int getTotalResults() {
return totalResults;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter Methods">
public void setId(int id) {
this.id = id;
}
public void setPage(int page) {
this.page = page;
}
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
public void setTotalResults(int totalResults) {
this.totalResults = totalResults;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
}
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Base class for the wrappers
*
* @author Stuart
*/
public class WrapperBase {
/*
* Logger - set but the sub-classes
*/
private Logger LOG;
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("page")
private int page;
@JsonProperty("total_pages")
private int totalPages;
@JsonProperty("total_results")
private int totalResults;
public WrapperBase(Logger LOG) {
this.LOG = LOG;
}
//<editor-fold defaultstate="collapsed" desc="Getter Methods">
public int getId() {
return id;
}
public int getPage() {
return page;
}
public int getTotalPages() {
return totalPages;
}
public int getTotalResults() {
return totalResults;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter Methods">
public void setId(int id) {
this.id = id;
}
public void setPage(int page) {
this.page = page;
}
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
public void setTotalResults(int totalResults) {
this.totalResults = totalResults;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
}
@@ -23,7 +23,8 @@ import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.MovieChanges;
import java.util.List;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
@@ -34,7 +35,7 @@ public class WrapperChanges {
* Logger
*/
private static final Logger logger = Logger.getLogger(WrapperChanges.class);
private static final Logger LOG = LoggerFactory.getLogger(WrapperChanges.class);
/*
* Properties
*/
@@ -64,6 +65,6 @@ public class WrapperChanges {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
LOG.trace(sb.toString());
}
}
@@ -22,7 +22,8 @@ package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Collection;
import java.util.List;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
@@ -36,7 +37,7 @@ public class WrapperCollection extends WrapperBase {
private List<Collection> results;
public WrapperCollection() {
super(Logger.getLogger(WrapperCollection.class));
super(LoggerFactory.getLogger(WrapperCollection.class));
}
public List<Collection> getResults() {
@@ -22,7 +22,8 @@ package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Company;
import java.util.List;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
@@ -36,7 +37,7 @@ public class WrapperCompany extends WrapperBase{
private List<Company> results;
public WrapperCompany() {
super(Logger.getLogger(WrapperCompany.class));
super(LoggerFactory.getLogger(WrapperCompany.class));
}
public List<Company> getResults() {
@@ -1,62 +1,63 @@
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.MovieDb;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author stuart.boston
*/
public class WrapperCompanyMovies extends WrapperBase {
/*
* Properties
*/
@JsonProperty("results")
private List<MovieDb> results;
public WrapperCompanyMovies() {
super(Logger.getLogger(WrapperCompanyMovies.class));
}
public List<MovieDb> getResults() {
return results;
}
public void setResults(List<MovieDb> results) {
this.results = results;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ResultList=[");
sb.append("[companyId=").append(getId());
sb.append("],[page=").append(getPage());
sb.append("],[pageResults=").append(getResults().size());
sb.append("],[totalPages=").append(getTotalPages());
sb.append("],[totalResults=").append(getTotalResults());
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.MovieDb;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
public class WrapperCompanyMovies extends WrapperBase {
/*
* Properties
*/
@JsonProperty("results")
private List<MovieDb> results;
public WrapperCompanyMovies() {
super(LoggerFactory.getLogger(WrapperCompanyMovies.class));
}
public List<MovieDb> getResults() {
return results;
}
public void setResults(List<MovieDb> results) {
this.results = results;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ResultList=[");
sb.append("[companyId=").append(getId());
sb.append("],[page=").append(getPage());
sb.append("],[pageResults=").append(getResults().size());
sb.append("],[totalPages=").append(getTotalPages());
sb.append("],[totalResults=").append(getTotalResults());
sb.append("]]");
return sb.toString();
}
}
@@ -24,7 +24,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.TmdbConfiguration;
import java.util.Collections;
import java.util.List;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
@@ -35,7 +36,7 @@ public class WrapperConfig {
* Logger
*/
private static final Logger logger = Logger.getLogger(WrapperConfig.class);
private static final Logger LOG = LoggerFactory.getLogger(WrapperConfig.class);
/*
* Properties
*/
@@ -71,6 +72,6 @@ public class WrapperConfig {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
LOG.trace(sb.toString());
}
}
@@ -1,66 +1,67 @@
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Genre;
import java.util.List;
import org.apache.log4j.Logger;
/**
* Wrapper class for the Genres searches
*
* @author Stuart
*/
public class WrapperGenres {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(WrapperGenres.class);
/*
* Properties
*/
@JsonProperty("genres")
private List<Genre> genres;
public List<Genre> getGenres() {
return genres;
}
public void setGenres(List<Genre> genres) {
this.genres = genres;
}
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
}
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Genre;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Wrapper class for the Genres searches
*
* @author Stuart
*/
public class WrapperGenres {
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(WrapperGenres.class);
/*
* Properties
*/
@JsonProperty("genres")
private List<Genre> genres;
public List<Genre> getGenres() {
return genres;
}
public void setGenres(List<Genre> genres) {
this.genres = genres;
}
/**
* Handle unknown properties and print a message
*
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
}
@@ -1,73 +1,74 @@
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Artwork;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class WrapperImages extends WrapperBase {
/*
* Properties
*/
@JsonProperty("backdrops")
private List<Artwork> backdrops;
@JsonProperty("posters")
private List<Artwork> posters;
@JsonProperty("profiles")
private List<Artwork> profiles;
public WrapperImages() {
super(Logger.getLogger(WrapperImages.class));
}
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public List<Artwork> getBackdrops() {
return backdrops;
}
public List<Artwork> getPosters() {
return posters;
}
public List<Artwork> getProfiles() {
return profiles;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setBackdrops(List<Artwork> backdrops) {
this.backdrops = backdrops;
}
public void setPosters(List<Artwork> posters) {
this.posters = posters;
}
public void setProfiles(List<Artwork> profiles) {
this.profiles = profiles;
}
//</editor-fold>
}
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Artwork;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class WrapperImages extends WrapperBase {
/*
* Properties
*/
@JsonProperty("backdrops")
private List<Artwork> backdrops;
@JsonProperty("posters")
private List<Artwork> posters;
@JsonProperty("profiles")
private List<Artwork> profiles;
public WrapperImages() {
super(LoggerFactory.getLogger(WrapperImages.class));
}
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public List<Artwork> getBackdrops() {
return backdrops;
}
public List<Artwork> getPosters() {
return posters;
}
public List<Artwork> getProfiles() {
return profiles;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setBackdrops(List<Artwork> backdrops) {
this.backdrops = backdrops;
}
public void setPosters(List<Artwork> posters) {
this.posters = posters;
}
public void setProfiles(List<Artwork> profiles) {
this.profiles = profiles;
}
//</editor-fold>
}
@@ -22,7 +22,8 @@ package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.KeywordMovie;
import java.util.List;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
@@ -36,7 +37,7 @@ public class WrapperKeywordMovies extends WrapperBase {
private List<KeywordMovie> results;
public WrapperKeywordMovies() {
super(Logger.getLogger(WrapperKeywordMovies.class));
super(LoggerFactory.getLogger(WrapperKeywordMovies.class));
}
public List<KeywordMovie> getResults() {
@@ -22,7 +22,8 @@ package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Keyword;
import java.util.List;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
@@ -36,7 +37,7 @@ public class WrapperKeywords extends WrapperBase {
private List<Keyword> results;
public WrapperKeywords() {
super(Logger.getLogger(WrapperKeywords.class));
super(LoggerFactory.getLogger(WrapperKeywords.class));
}
public List<Keyword> getResults() {
@@ -1,62 +1,63 @@
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.MovieDb;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author stuart.boston
*/
public class WrapperMovie extends WrapperBase {
/*
* Properties
*/
@JsonProperty("results")
private List<MovieDb> movies;
public WrapperMovie() {
super(Logger.getLogger(WrapperMovie.class));
}
public List<MovieDb> getMovies() {
return movies;
}
public void setMovies(List<MovieDb> movies) {
this.movies = movies;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ResultList=[");
sb.append("[page=").append(getPage());
sb.append("],[pageResults=").append(getMovies().size());
sb.append("],[totalPages=").append(getTotalPages());
sb.append("],[totalResults=").append(getTotalResults());
sb.append("],[id=").append(getId());
sb.append("]]");
return sb.toString();
}
}
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.MovieDb;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
public class WrapperMovie extends WrapperBase {
/*
* Properties
*/
@JsonProperty("results")
private List<MovieDb> movies;
public WrapperMovie() {
super(LoggerFactory.getLogger(WrapperMovie.class));
}
public List<MovieDb> getMovies() {
return movies;
}
public void setMovies(List<MovieDb> movies) {
this.movies = movies;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ResultList=[");
sb.append("[page=").append(getPage());
sb.append("],[pageResults=").append(getMovies().size());
sb.append("],[totalPages=").append(getTotalPages());
sb.append("],[totalResults=").append(getTotalResults());
sb.append("],[id=").append(getId());
sb.append("]]");
return sb.toString();
}
}
@@ -1,89 +1,90 @@
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.PersonCast;
import com.omertron.themoviedbapi.model.PersonCrew;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class WrapperMovieCasts {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(WrapperMovieCasts.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("cast")
private List<PersonCast> cast;
@JsonProperty("crew")
private List<PersonCrew> crew;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public List<PersonCast> getCast() {
return cast;
}
public List<PersonCrew> getCrew() {
return crew;
}
public int getId() {
return id;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCast(List<PersonCast> cast) {
this.cast = cast;
}
public void setCrew(List<PersonCrew> crew) {
this.crew = crew;
}
public void setId(int id) {
this.id = id;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
}
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.PersonCast;
import com.omertron.themoviedbapi.model.PersonCrew;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class WrapperMovieCasts {
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(WrapperMovieCasts.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("cast")
private List<PersonCast> cast;
@JsonProperty("crew")
private List<PersonCrew> crew;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public List<PersonCast> getCast() {
return cast;
}
public List<PersonCrew> getCrew() {
return crew;
}
public int getId() {
return id;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCast(List<PersonCast> cast) {
this.cast = cast;
}
public void setCrew(List<PersonCrew> crew) {
this.crew = crew;
}
public void setId(int id) {
this.id = id;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
}
@@ -1,78 +1,79 @@
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Keyword;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class WrapperMovieKeywords {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(WrapperMovieKeywords.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("keywords")
private List<Keyword> keywords;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getId() {
return id;
}
public List<Keyword> getKeywords() {
return keywords;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(int id) {
this.id = id;
}
public void setKeywords(List<Keyword> keywords) {
this.keywords = keywords;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
}
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Keyword;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class WrapperMovieKeywords {
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(WrapperMovieKeywords.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("keywords")
private List<Keyword> keywords;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getId() {
return id;
}
public List<Keyword> getKeywords() {
return keywords;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(int id) {
this.id = id;
}
public void setKeywords(List<Keyword> keywords) {
this.keywords = keywords;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
}
@@ -1,50 +1,51 @@
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.MovieList;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class WrapperMovieList extends WrapperBase {
/*
* Properties
*/
@JsonProperty("results")
private List<MovieList> movieList;
public WrapperMovieList() {
super(Logger.getLogger(WrapperMovieList.class));
}
public List<MovieList> getMovieList() {
return movieList;
}
public void setMovieList(List<MovieList> movieList) {
this.movieList = movieList;
}
}
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.MovieList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class WrapperMovieList extends WrapperBase {
/*
* Properties
*/
@JsonProperty("results")
private List<MovieList> movieList;
public WrapperMovieList() {
super(LoggerFactory.getLogger(WrapperMovieList.class));
}
public List<MovieList> getMovieList() {
return movieList;
}
public void setMovieList(List<MovieList> movieList) {
this.movieList = movieList;
}
}
@@ -22,7 +22,8 @@ package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Person;
import java.util.List;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
@@ -36,7 +37,7 @@ public class WrapperPerson extends WrapperBase {
private List<Person> results;
public WrapperPerson() {
super(Logger.getLogger(WrapperPerson.class));
super(LoggerFactory.getLogger(WrapperPerson.class));
}
public List<Person> getResults() {
@@ -22,7 +22,8 @@ package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.PersonCredit;
import java.util.List;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
@@ -38,7 +39,7 @@ public class WrapperPersonCredits extends WrapperBase{
private List<PersonCredit> crew;
public WrapperPersonCredits() {
super(Logger.getLogger(WrapperMovieCasts.class));
super(LoggerFactory.getLogger(WrapperMovieCasts.class));
}
public List<PersonCredit> getCast() {
@@ -1,78 +1,79 @@
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.ReleaseInfo;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class WrapperReleaseInfo {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(WrapperReleaseInfo.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("countries")
private List<ReleaseInfo> countries;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public List<ReleaseInfo> getCountries() {
return countries;
}
public int getId() {
return id;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCountries(List<ReleaseInfo> countries) {
this.countries = countries;
}
public void setId(int id) {
this.id = id;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
}
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.ReleaseInfo;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class WrapperReleaseInfo {
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(WrapperReleaseInfo.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("countries")
private List<ReleaseInfo> countries;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public List<ReleaseInfo> getCountries() {
return countries;
}
public int getId() {
return id;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCountries(List<ReleaseInfo> countries) {
this.countries = countries;
}
public void setId(int id) {
this.id = id;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
}
@@ -1,88 +1,89 @@
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Trailer;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class WrapperTrailers {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(WrapperTrailers.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("quicktime")
private List<Trailer> quicktime;
@JsonProperty("youtube")
private List<Trailer> youtube;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getId() {
return id;
}
public List<Trailer> getQuicktime() {
return quicktime;
}
public List<Trailer> getYoutube() {
return youtube;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(int id) {
this.id = id;
}
public void setQuicktime(List<Trailer> quicktime) {
this.quicktime = quicktime;
}
public void setYoutube(List<Trailer> youtube) {
this.youtube = youtube;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
}
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Trailer;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class WrapperTrailers {
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(WrapperTrailers.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("quicktime")
private List<Trailer> quicktime;
@JsonProperty("youtube")
private List<Trailer> youtube;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getId() {
return id;
}
public List<Trailer> getQuicktime() {
return quicktime;
}
public List<Trailer> getYoutube() {
return youtube;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(int id) {
this.id = id;
}
public void setQuicktime(List<Trailer> quicktime) {
this.quicktime = quicktime;
}
public void setYoutube(List<Trailer> youtube) {
this.youtube = youtube;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
}
@@ -1,78 +1,79 @@
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Translation;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author Stuart
*/
public class WrapperTranslations {
/*
* Logger
*/
private static final Logger logger = Logger.getLogger(WrapperTranslations.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("translations")
private List<Translation> translations;
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(int id) {
this.id = id;
}
public void setTranslations(List<Translation> translations) {
this.translations = translations;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getId() {
return id;
}
public List<Translation> getTranslations() {
return translations;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
logger.trace(sb.toString());
}
}
/*
* Copyright (c) 2004-2013 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.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.Translation;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class WrapperTranslations {
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(WrapperTranslations.class);
/*
* Properties
*/
@JsonProperty("id")
private int id;
@JsonProperty("translations")
private List<Translation> translations;
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(int id) {
this.id = id;
}
public void setTranslations(List<Translation> translations) {
this.translations = translations;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public int getId() {
return id;
}
public List<Translation> getTranslations() {
return translations;
}
//</editor-fold>
/**
* Handle unknown properties and print a message
* @param key
* @param value
*/
@JsonAnySetter
public void handleUnknown(String key, Object value) {
StringBuilder sb = new StringBuilder();
sb.append("Unknown property: '").append(key);
sb.append("' value: '").append(value).append("'");
LOG.trace(sb.toString());
}
}
@@ -1,7 +0,0 @@
log4j.rootLogger=DEBUG, CONSOLE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=com.omertron.themoviedbapi.tools.FilteringLayout
#log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[TheMovieDB API-%C{1}] %m%n
#log4j.appender.CONSOLE.Threshold=DEBUG
log4j.appender.CONSOLE.Encoding=UTF-8
@@ -39,14 +39,12 @@ import com.omertron.themoviedbapi.model.TokenAuthorisation;
import com.omertron.themoviedbapi.model.TokenSession;
import com.omertron.themoviedbapi.model.Trailer;
import com.omertron.themoviedbapi.model.Translation;
import com.omertron.themoviedbapi.tools.FilteringLayout;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.*;
import static org.junit.Assert.*;
@@ -58,7 +56,7 @@ import static org.junit.Assert.*;
public class TheMovieDbApiTest {
// Logger
private static final Logger logger = Logger.getLogger(TheMovieDbApiTest.class);
private static final Logger LOG = Logger.getLogger(TheMovieDbApiTest.class.getSimpleName());
// API Key
private static final String API_KEY = "5a1a77e2eba8984804586122754f969f";
private static TheMovieDbApi tmdb;
@@ -79,9 +77,8 @@ public class TheMovieDbApiTest {
@BeforeClass
public static void setUpClass() throws Exception {
BasicConfigurator.configure();
// Set the logger level to TRACE
Logger.getRootLogger().setLevel(Level.TRACE);
// Set the LOG level to ALL
LOG.setLevel(Level.ALL);
tmdb = new TheMovieDbApi(API_KEY);
}
@@ -91,8 +88,6 @@ public class TheMovieDbApiTest {
@Before
public void setUp() {
// Make sure the filter isn't applied to the test output
FilteringLayout.addReplacementString("DO_NOT_MATCH");
}
@After
@@ -104,7 +99,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testConfiguration() throws IOException {
logger.info("Test Configuration");
LOG.info("Test Configuration");
TmdbConfiguration tmdbConfig = tmdb.getConfiguration();
assertNotNull("Configuration failed", tmdbConfig);
@@ -112,7 +107,7 @@ public class TheMovieDbApiTest {
assertTrue("No backdrop sizes", tmdbConfig.getBackdropSizes().size() > 0);
assertTrue("No poster sizes", tmdbConfig.getPosterSizes().size() > 0);
assertTrue("No profile sizes", tmdbConfig.getProfileSizes().size() > 0);
logger.info(tmdbConfig.toString());
LOG.info(tmdbConfig.toString());
}
/**
@@ -120,7 +115,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testSearchMovie() throws MovieDbException {
logger.info("searchMovie");
LOG.info("searchMovie");
// Try a movie with less than 1 page of results
List<MovieDb> movieList = tmdb.searchMovie("Blade Runner", 0, "", true, 0);
@@ -128,7 +123,7 @@ public class TheMovieDbApiTest {
assertTrue("No movies found, should be at least 1", movieList.size() > 0);
// Try a russian langugage movie
movieList = tmdb.searchMovie("О чём говорят мужчины", 0, "ru", true, 0);
movieList = tmdb.searchMovie("О чём говор?т мужчины", 0, "ru", true, 0);
assertTrue("No movies found, should be at least 1", movieList.size() > 0);
// Try a movie with more than 20 results
@@ -141,7 +136,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetMovieInfo() throws MovieDbException {
logger.info("getMovieInfo");
LOG.info("getMovieInfo");
String language = "en";
MovieDb result = tmdb.getMovieInfo(ID_MOVIE_BLADE_RUNNER, language);
assertEquals("Incorrect movie information", "Blade Runner", result.getOriginalTitle());
@@ -152,7 +147,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetMovieAlternativeTitles() throws MovieDbException {
logger.info("getMovieAlternativeTitles");
LOG.info("getMovieAlternativeTitles");
String country = "";
List<AlternativeTitle> results = tmdb.getMovieAlternativeTitles(ID_MOVIE_BLADE_RUNNER, country);
assertTrue("No alternative titles found", results.size() > 0);
@@ -168,7 +163,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetMovieCasts() throws MovieDbException {
logger.info("getMovieCasts");
LOG.info("getMovieCasts");
List<Person> people = tmdb.getMovieCasts(ID_MOVIE_BLADE_RUNNER);
assertTrue("No cast information", people.size() > 0);
@@ -195,7 +190,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetMovieImages() throws MovieDbException {
logger.info("getMovieImages");
LOG.info("getMovieImages");
String language = "";
List<Artwork> result = tmdb.getMovieImages(ID_MOVIE_BLADE_RUNNER, language);
assertFalse("No artwork found", result.isEmpty());
@@ -206,7 +201,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetMovieKeywords() throws MovieDbException {
logger.info("getMovieKeywords");
LOG.info("getMovieKeywords");
List<Keyword> result = tmdb.getMovieKeywords(ID_MOVIE_BLADE_RUNNER);
assertFalse("No keywords found", result.isEmpty());
}
@@ -216,7 +211,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetMovieReleaseInfo() throws MovieDbException {
logger.info("getMovieReleaseInfo");
LOG.info("getMovieReleaseInfo");
List<ReleaseInfo> result = tmdb.getMovieReleaseInfo(ID_MOVIE_BLADE_RUNNER, "");
assertFalse("Release information missing", result.isEmpty());
}
@@ -226,7 +221,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetMovieTrailers() throws MovieDbException {
logger.info("getMovieTrailers");
LOG.info("getMovieTrailers");
List<Trailer> result = tmdb.getMovieTrailers(ID_MOVIE_BLADE_RUNNER, "");
assertFalse("Movie trailers missing", result.isEmpty());
}
@@ -236,7 +231,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetMovieTranslations() throws MovieDbException {
logger.info("getMovieTranslations");
LOG.info("getMovieTranslations");
List<Translation> result = tmdb.getMovieTranslations(ID_MOVIE_BLADE_RUNNER);
assertFalse("No translations found", result.isEmpty());
}
@@ -246,7 +241,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetCollectionInfo() throws MovieDbException {
logger.info("getCollectionInfo");
LOG.info("getCollectionInfo");
String language = "";
CollectionInfo result = tmdb.getCollectionInfo(ID_MOVIE_STAR_WARS_COLLECTION, language);
assertFalse("No collection information", result.getParts().isEmpty());
@@ -259,7 +254,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testCreateImageUrl() throws MovieDbException {
logger.info("createImageUrl");
LOG.info("createImageUrl");
MovieDb movie = tmdb.getMovieInfo(ID_MOVIE_BLADE_RUNNER, "");
String result = tmdb.createImageUrl(movie.getPosterPath(), "original").toString();
assertTrue("Error compiling image URL", !result.isEmpty());
@@ -270,7 +265,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetMovieInfoImdb() throws MovieDbException {
logger.info("getMovieInfoImdb");
LOG.info("getMovieInfoImdb");
MovieDb result = tmdb.getMovieInfoImdb("tt0076759", "en-US");
assertTrue("Error getting the movie from IMDB ID", result.getId() == 11);
}
@@ -304,7 +299,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testSearchPeople() throws MovieDbException {
logger.info("searchPeople");
LOG.info("searchPeople");
String personName = "Bruce Willis";
boolean includeAdult = false;
List<Person> result = tmdb.searchPeople(personName, includeAdult, 0);
@@ -316,7 +311,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetPersonInfo() throws MovieDbException {
logger.info("getPersonInfo");
LOG.info("getPersonInfo");
Person result = tmdb.getPersonInfo(ID_PERSON_BRUCE_WILLIS);
assertTrue("Wrong actor returned", result.getId() == ID_PERSON_BRUCE_WILLIS);
}
@@ -326,7 +321,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetPersonCredits() throws MovieDbException {
logger.info("getPersonCredits");
LOG.info("getPersonCredits");
List<PersonCredit> people = tmdb.getPersonCredits(ID_PERSON_BRUCE_WILLIS);
assertTrue("No cast information", people.size() > 0);
@@ -337,7 +332,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetPersonImages() throws MovieDbException {
logger.info("getPersonImages");
LOG.info("getPersonImages");
List<Artwork> artwork = tmdb.getPersonImages(ID_PERSON_BRUCE_WILLIS);
assertTrue("No cast information", artwork.size() > 0);
@@ -348,7 +343,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetLatestMovie() throws MovieDbException {
logger.info("getLatestMovie");
LOG.info("getLatestMovie");
MovieDb result = tmdb.getLatestMovie();
assertTrue("No latest movie found", result != null);
assertTrue("No latest movie found", result.getId() > 0);
@@ -383,7 +378,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetNowPlayingMovies() throws MovieDbException {
logger.info("getNowPlayingMovies");
LOG.info("getNowPlayingMovies");
List<MovieDb> results = tmdb.getNowPlayingMovies(LANGUAGE_DEFAULT, 0);
assertTrue("No now playing movies found", !results.isEmpty());
}
@@ -393,7 +388,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetPopularMovieList() throws MovieDbException {
logger.info("getPopularMovieList");
LOG.info("getPopularMovieList");
List<MovieDb> results = tmdb.getPopularMovieList(LANGUAGE_DEFAULT, 0);
assertTrue("No popular movies found", !results.isEmpty());
}
@@ -403,7 +398,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetTopRatedMovies() throws MovieDbException {
logger.info("getTopRatedMovies");
LOG.info("getTopRatedMovies");
List<MovieDb> results = tmdb.getTopRatedMovies(LANGUAGE_DEFAULT, 0);
assertTrue("No top rated movies found", !results.isEmpty());
}
@@ -413,7 +408,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetCompanyInfo() throws MovieDbException {
logger.info("getCompanyInfo");
LOG.info("getCompanyInfo");
Company company = tmdb.getCompanyInfo(ID_COMPANY_LUCASFILM);
assertTrue("No company information found", company.getCompanyId() > 0);
}
@@ -423,7 +418,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetCompanyMovies() throws MovieDbException {
logger.info("getCompanyMovies");
LOG.info("getCompanyMovies");
List<MovieDb> results = tmdb.getCompanyMovies(ID_COMPANY_LUCASFILM, LANGUAGE_DEFAULT, 0);
assertTrue("No company movies found", !results.isEmpty());
}
@@ -433,7 +428,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testSearchCompanies() throws MovieDbException {
logger.info("searchCompanies");
LOG.info("searchCompanies");
List<Company> results = tmdb.searchCompanies(COMPANY_NAME, 0);
assertTrue("No company information found", !results.isEmpty());
}
@@ -443,7 +438,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetSimilarMovies() throws MovieDbException {
logger.info("getSimilarMovies");
LOG.info("getSimilarMovies");
List<MovieDb> results = tmdb.getSimilarMovies(ID_MOVIE_BLADE_RUNNER, LANGUAGE_DEFAULT, 0);
assertTrue("No similar movies found", !results.isEmpty());
}
@@ -453,7 +448,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetGenreList() throws MovieDbException {
logger.info("getGenreList");
LOG.info("getGenreList");
List<Genre> results = tmdb.getGenreList(LANGUAGE_DEFAULT);
assertTrue("No genres found", !results.isEmpty());
}
@@ -463,7 +458,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetGenreMovies() throws MovieDbException {
logger.info("getGenreMovies");
LOG.info("getGenreMovies");
List<MovieDb> results = tmdb.getGenreMovies(ID_GENRE_ACTION, LANGUAGE_DEFAULT, 0);
assertTrue("No genre movies found", !results.isEmpty());
}
@@ -473,7 +468,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetUpcoming() throws Exception {
logger.info("getUpcoming");
LOG.info("getUpcoming");
List<MovieDb> results = tmdb.getUpcoming(LANGUAGE_DEFAULT, 0);
assertTrue("No upcoming movies found", !results.isEmpty());
}
@@ -483,7 +478,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetCollectionImages() throws Exception {
logger.info("getCollectionImages");
LOG.info("getCollectionImages");
List<Artwork> result = tmdb.getCollectionImages(ID_MOVIE_STAR_WARS_COLLECTION, LANGUAGE_DEFAULT);
assertFalse("No artwork found", result.isEmpty());
}
@@ -493,11 +488,11 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetAuthorisationToken() throws Exception {
logger.info("getAuthorisationToken");
LOG.info("getAuthorisationToken");
TokenAuthorisation result = tmdb.getAuthorisationToken();
assertFalse("Token is null", result == null);
assertTrue("Token is not valid", result.getSuccess());
logger.info(result.toString());
LOG.info(result.toString());
}
/**
@@ -506,16 +501,16 @@ public class TheMovieDbApiTest {
* TODO: Cannot be tested without a HTTP authorisation: http://help.themoviedb.org/kb/api/user-authentication
*/
public void testGetSessionToken() throws Exception {
logger.info("getSessionToken");
LOG.info("getSessionToken");
TokenAuthorisation token = tmdb.getAuthorisationToken();
assertFalse("Token is null", token == null);
assertTrue("Token is not valid", token.getSuccess());
logger.info(token.toString());
LOG.info(token.toString());
TokenSession result = tmdb.getSessionToken(token);
assertFalse("Session token is null", result == null);
assertTrue("Session token is not valid", result.getSuccess());
logger.info(result.toString());
LOG.info(result.toString());
}
/**
@@ -523,7 +518,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetGuestSessionToken() throws Exception {
logger.info("getGuestSessionToken");
LOG.info("getGuestSessionToken");
TokenSession result = tmdb.getGuestSessionToken();
assertTrue("Failed to get guest session", result.getSuccess());
@@ -531,7 +526,7 @@ public class TheMovieDbApiTest {
@Test
public void testGetMovieLists() throws Exception {
logger.info("getMovieLists");
LOG.info("getMovieLists");
String language = "en";
List<MovieList> results = tmdb.getMovieLists(ID_MOVIE_BLADE_RUNNER, language, 0);
assertNotNull("No results found", results);
@@ -544,7 +539,7 @@ public class TheMovieDbApiTest {
* TODO: Do not test this until it is fixed
*/
public void testGetMovieChanges() throws Exception {
logger.info("getMovieChanges");
LOG.info("getMovieChanges");
String startDate = "";
String endDate = null;
@@ -554,7 +549,7 @@ public class TheMovieDbApiTest {
List<MovieDb> movieList = tmdb.getPopularMovieList(LANGUAGE_DEFAULT, 0);
for (MovieDb movie : movieList) {
results = tmdb.getMovieChanges(movie.getId(), startDate, endDate);
logger.info(movie.getTitle() + " has " + results.size() + " changes.");
LOG.log(Level.INFO, "{0} has {1} changes.", new Object[]{movie.getTitle(), results.size()});
}
assertNotNull("No results found", results);
@@ -563,7 +558,7 @@ public class TheMovieDbApiTest {
@Test
public void testGetPersonLatest() throws Exception {
logger.info("getPersonLatest");
LOG.info("getPersonLatest");
Person result = tmdb.getPersonLatest();
@@ -576,7 +571,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testSearchCollection() throws Exception {
logger.info("searchCollection");
LOG.info("searchCollection");
String query = "batman";
int page = 0;
List<Collection> result = tmdb.searchCollection(query, LANGUAGE_DEFAULT, page);
@@ -589,7 +584,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testSearchList() throws Exception {
logger.info("searchList");
LOG.info("searchList");
String query = "watch";
int page = 0;
List result = tmdb.searchList(query, LANGUAGE_DEFAULT, page);
@@ -602,7 +597,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testSearchKeyword() throws Exception {
logger.info("searchKeyword");
LOG.info("searchKeyword");
String query = "action";
int page = 0;
List<Keyword> result = tmdb.searchKeyword(query, page);
@@ -616,7 +611,7 @@ public class TheMovieDbApiTest {
* TODO: Cannot be tested without a HTTP authorisation: http://help.themoviedb.org/kb/api/user-authentication
*/
public void testPostMovieRating() throws Exception {
logger.info("postMovieRating");
LOG.info("postMovieRating");
String sessionId = "";
String rating = "";
boolean expResult = false;
@@ -632,7 +627,7 @@ public class TheMovieDbApiTest {
* TODO: Fix the method before testing
*/
public void testGetPersonChanges() throws Exception {
logger.info("getPersonChanges");
LOG.info("getPersonChanges");
String startDate = "";
String endDate = "";
tmdb.getPersonChanges(ID_PERSON_BRUCE_WILLIS, startDate, endDate);
@@ -643,7 +638,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetList() throws Exception {
logger.info("getList");
LOG.info("getList");
String listId = "509ec17b19c2950a0600050d";
MovieDbList result = tmdb.getList(listId);
assertFalse("List not found", result.getItems().isEmpty());
@@ -654,7 +649,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetKeyword() throws Exception {
logger.info("getKeyword");
LOG.info("getKeyword");
Keyword result = tmdb.getKeyword(ID_KEYWORD);
assertEquals("fight", result.getName());
}
@@ -664,7 +659,7 @@ public class TheMovieDbApiTest {
*/
@Test
public void testGetKeywordMovies() throws Exception {
logger.info("getKeywordMovies");
LOG.info("getKeywordMovies");
int page = 0;
List<KeywordMovie> result = tmdb.getKeywordMovies(ID_KEYWORD, LANGUAGE_DEFAULT, page);
assertFalse("No keyword movies found", result.isEmpty());