45 Commits

Author SHA1 Message Date
Omertron 24f7b507b9 [maven-release-plugin] prepare release themoviedbapi-3.6 2013-06-26 14:31:25 +02:00
Stuart Boston d298faec9a Removed getMovieChanges test 2013-06-26 13:29:24 +01:00
Stuart Boston 486486b753 Removed unused imports 2013-06-26 13:02:23 +01:00
Stuart Boston 159fe23efb Updated POM versions 2013-06-13 21:48:34 +01:00
Stuart Boston fc1e05d0b4 Added HTTP 503 error and message 2013-06-13 07:30:18 +01:00
Stuart Boston dc6f5f07b1 Standardised toString methods 2013-06-09 22:26:16 +01:00
Stuart Boston 4243b5aa81 Catch RuntimeException when 503 error 2013-06-09 18:23:41 +01:00
Stuart Boston 1070abcabc Update README.md 2013-06-04 10:38:46 +02:00
Stuart Boston 9cca4660bc Add adult and popularity to KeywordMovie 2013-06-03 12:13:46 +01:00
Stuart Boston 5f27260f57 Updated api-common dependency 2013-05-31 09:59:05 +01:00
Stuart Boston bec9b24129 Reverted to "com.moviejukebox" for groupId 2013-05-28 20:18:39 +01:00
Stuart Boston 8679b03930 Updated to use API-Common component for HTTPClient functionality 2013-05-28 14:27:00 +01:00
Stuart Boston 845aedf871 Added MovieChange method 2013-05-20 13:05:19 +01:00
Stuart Boston d6adc40215 Fix correct logging class for JobDepartment 2013-05-20 13:03:55 +01:00
Stuart Boston 17815b9ffc Fixed some issues 2013-05-20 10:36:01 +01:00
Stuart Boston 60cb490eca Add appendToResponse to person methods 2013-05-19 18:42:26 +01:00
Stuart Boston f08c78c921 Corrected resultsMap
Removed unused imports
2013-05-19 08:24:24 +01:00
Stuart Boston 0414369327 Removed unused imports and dead variables 2013-05-18 22:22:51 +01:00
Stuart Boston 44ba85aaa8 Changed return values to include page values 2013-05-18 22:08:40 +01:00
Stuart Boston 009e725cb6 Added new classes to return the results 2013-05-18 11:23:44 +01:00
Stuart Boston edf4518f35 Refactored Wrapper classes 2013-05-17 22:15:52 +01:00
Omertron c6248b621e [maven-release-plugin] prepare for next development iteration 2013-05-15 20:34:38 +02:00
Omertron 7900b6d25b [maven-release-plugin] prepare release themoviedbapi-3.5 2013-05-15 20:34:15 +02:00
Omertron 4747c42fc6 Updated POM versions 2013-05-15 20:31:44 +02:00
Stuart Boston 1a96343924 Updated Test class 2013-05-15 18:15:12 +01:00
Stuart Boston 76191c13c0 Add overview to CollectionInfo 2013-05-15 18:14:54 +01:00
Stuart Boston ce533c2b41 removed unused log messages in test class 2013-05-15 18:06:54 +01:00
Stuart Boston de623ff0db Add discover method 2013-05-15 16:24:57 +01:00
Stuart Boston 6745f5f3d5 Fix issue with WrapperImages not having initialised collections 2013-05-15 14:16:15 +01:00
Stuart Boston 955ef0369e Add Job List 2013-05-15 14:09:57 +01:00
Stuart Boston 4c682731b6 Add PopularPerson method 2013-05-15 13:46:59 +01:00
Stuart Boston c99f60f636 Un"ignored" the tests 2013-05-15 13:22:06 +01:00
Stuart Boston 265878d016 Added AppendToResponse for MovieDb (MovieInfo methods) 2013-05-15 13:19:02 +01:00
Stuart Boston 9bf7175ee8 Add "getAll" method to Images and Trailers 2013-05-15 13:18:14 +01:00
Stuart Boston 00063cc85d Add reviews 2013-05-15 13:16:44 +01:00
Stuart Boston 2f7468914c Allow AppendToReponse to contain multiple elements 2013-05-15 11:51:20 +01:00
Stuart Boston 4d9d53421f Add placeholder "append_to_response" parameters 2013-05-14 16:20:27 +01:00
Stuart Boston 9f135c3ca7 Removed reliance on MovieDb object from ApiBuilder 2013-05-14 16:01:25 +01:00
Stuart Boston 7d9552a08c Updated bin.xml to add correct README 2013-04-19 10:03:42 +01:00
Stuart Boston 3acf07b36a Non-functional changes to POM and bin.xml 2013-04-19 09:35:09 +01:00
Stuart Boston f501126b76 Reverted build version to 1.6 2013-04-03 15:05:45 +01:00
Stuart Boston 8ab8699dd5 updated version.txt 2013-03-25 22:08:40 +00:00
Stuart Boston 6c4ba2a492 Updated version.txt 2013-03-25 21:49:50 +00:00
Stuart Boston 44df73f2d1 Updated POM versions and build number 2013-03-25 20:57:44 +00:00
Omertron 98a1b5d1b9 [maven-release-plugin] prepare for next development iteration 2013-03-18 13:45:57 +01:00
69 changed files with 4307 additions and 3325 deletions
+2 -1
View File
@@ -5,4 +5,5 @@
*.war
*.ear
/target/
/target/
/nbactions.xml
+12 -6
View File
@@ -3,17 +3,23 @@ The Movie DB API
Author: Stuart Boston (Omertron AT Gmail DOT com)
This API uses the TheMovieDB.org API as specified here http://api.themoviedb.org/
This API uses the [TheMovieDB.org API](http://api.themoviedb.org/)
Originally written for use by YetAnotherMovieJukebox (YAMJ) http://code.google.com/p/moviejukebox/
But anyone can feel free to use it for other projects as well.
Originally written for use by Yet Another Movie Jukebox [(YAMJ)](http://code.google.com/p/moviejukebox/)
TheMovieDB.org is an excellent open database for movie and film content. I encourage you to check it out and contribute to keep it growing.
http://www.themoviedb.org
But anyone can use it for other projects as well.
***
### TheMovieDB.org
This is an excellent open database for movie and film content.
I *strongly* encourage you to check it out and contribute to keep it growing.
### http://www.themoviedb.org
***
Project Logging
---------------
This project uses SLF4J (http://www.slf4j.org) to abstract the logging in the project.
This project uses [SLF4J](http://www.slf4j.org) to abstract the logging in the project.
To use the logging in your own project you should add one of the bindings listed [HERE](http://www.slf4j.org/manual.html#swapping)
Project Documentation
+41 -27
View File
@@ -13,7 +13,7 @@
<groupId>com.omertron</groupId>
<artifactId>themoviedbapi</artifactId>
<version>3.4</version>
<version>3.6</version>
<packaging>jar</packaging>
<name>API-The MovieDB</name>
@@ -62,7 +62,7 @@
</issueManagement>
<ciManagement>
<system>Hudson CI</system>
<system>Jenkins CI</system>
<url>http://jenkins.omertron.com/job/API-TheMovieDb/</url>
</ciManagement>
@@ -74,61 +74,62 @@
</properties>
<dependencies>
<!--TESTING-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!--JSON-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.1.4</version>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.1.4</version>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.1.4</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
<version>2.2.2</version>
</dependency>
<!--LOGGING-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.3</version>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.3</version>
<version>1.7.5</version>
<scope>test</scope>
</dependency>
<!--COMMON HTTP TOOLS-->
<dependency>
<groupId>org.yamj</groupId>
<artifactId>api-common</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}-${project.version}-r${buildNumber}</finalName>
<finalName>${project.artifactId}-${project.version}-${buildNumber}</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<getRevisionOnlyOnce>true</getRevisionOnlyOnce>
<revisionOnScmFailure>0000</revisionOnScmFailure>
<shortRevisionLength>10</shortRevisionLength>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<timestampFormat>{0,date,yyyy-MM-dd HH:mm:ss}</timestampFormat>
</configuration>
<executions>
@@ -140,10 +141,11 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
@@ -152,6 +154,7 @@
<!-- excludes><exclude>**/*</exclude></excludes -->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
@@ -167,15 +170,17 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.13</version>
<version>2.14.1</version>
<configuration>
<!-- To skip tests by default -->
<skipTests>${skipTests}</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
@@ -190,12 +195,12 @@
<property name="header_line" value="The MovieDb API${line.separator}" />
<property name="build_date_line" value="Build Date: ${timestamp}${line.separator}" />
<property name="version_line" value="Version: ${project.version}${line.separator}" />
<!--<property name="revision_line" value="Revision: r${buildNumber}${line.separator}" />-->
<property name="buildnumber_line" value="Git-SHA: ${buildNumber}${line.separator}" />
<echo>Writing version file: ${version_file}</echo>
<echo file="${version_file}" append="false">${header_line}</echo>
<echo file="${version_file}" append="true">${build_date_line}</echo>
<echo file="${version_file}" append="true">${version_line}</echo>
<!--<echo file="${version_file}" append="true">${revision_line}</echo>-->
<echo file="${version_file}" append="true">${buildnumber_line}</echo>
</target>
</configuration>
<goals>
@@ -204,6 +209,7 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
@@ -223,15 +229,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.2</version>
<version>3.3</version>
<configuration>
<reportPlugins>
<plugin>
@@ -259,43 +267,49 @@
</reportPlugins>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.4</version>
<version>1.8.1</version>
</extension>
<extension>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-manager-plexus</artifactId>
<version>1.4</version>
<version>1.8.1</version>
</extension>
<extension>
<groupId>org.kathrynhuxtable.maven.wagon</groupId>
@@ -55,7 +55,11 @@ public class MovieDbException extends Exception {
/*
* Autorisation rejected
*/
AUTHORISATION_FAILURE;
AUTHORISATION_FAILURE,
/*
* Service Unavailable, usually temporary
*/
HTTP_503_ERROR;
}
private final MovieDbExceptionType exceptionType;
File diff suppressed because it is too large Load Diff
@@ -22,6 +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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -107,10 +109,6 @@ public class AlternativeTitle implements Serializable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[AlternativeTitle=");
sb.append("[country=").append(country);
sb.append("],[title=").append(title);
sb.append("]]");
return sb.toString();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -22,6 +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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -195,14 +197,6 @@ public class Artwork implements Serializable {
@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();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -0,0 +1,52 @@
package com.omertron.themoviedbapi.model;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class ChangeKeyItem {
private static final long serialVersionUID = 1L;
@JsonProperty("key")
private String key;
@JsonProperty("items")
private List<ChangedItem> changedItems = new ArrayList<ChangedItem>();
private Map<String, Object> newItems = new HashMap<String, Object>();
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public List<ChangedItem> getChangedItems() {
return changedItems;
}
public void setChangedItems(List<ChangedItem> changes) {
this.changedItems = changes;
}
@JsonAnyGetter
public Map<String, Object> getNewItems() {
return this.newItems;
}
@JsonAnySetter
public void setNewItems(String name, Object value) {
this.newItems.put(name, value);
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -1,128 +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.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ChangeValue {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(MovieChanges.class);
/*
* Properties
*/
@JsonProperty("poster")
private Artwork poster;
@JsonProperty("backdrop")
private Artwork backdrop;
@JsonProperty("title")
private String title;
@JsonProperty("iso_3166_1")
private String language;
@JsonProperty("site")
private String site;
@JsonProperty("name")
private String name;
@JsonProperty("id")
private int id;
//<editor-fold defaultstate="collapsed" desc="Getter Methods">
public Artwork getPoster() {
return poster;
}
public Artwork getBackdrop() {
return backdrop;
}
public String getTitle() {
return title;
}
public String getLanguage() {
return language;
}
public String getSite() {
return site;
}
public String getName() {
return name;
}
public int getId() {
return id;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter Methods">
public void setPoster(Artwork poster) {
this.poster = poster;
}
public void setBackdrop(Artwork backdrop) {
this.backdrop = backdrop;
backdrop.setArtworkType(ArtworkType.BACKDROP);
}
public void setTitle(String title) {
this.title = title;
}
public void setLanguage(String language) {
this.language = language;
}
public void setSite(String site) {
this.site = site;
}
public void setName(String name) {
this.name = name;
}
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());
}
}
@@ -0,0 +1,80 @@
package com.omertron.themoviedbapi.model;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class ChangedItem {
private static final long serialVersionUID = 1L;
@JsonProperty("id")
private String id;
@JsonProperty("action")
private String action;
@JsonProperty("time")
private String time;
@JsonProperty("iso_639_1")
private String language;
@JsonProperty("value")
private Object value;
private Map<String, Object> newItems = new HashMap<String, Object>();
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
@JsonAnyGetter
public Map<String, Object> getNewItems() {
return this.newItems;
}
@JsonAnySetter
public void setNewItems(String name, Object value) {
this.newItems.put(name, value);
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -24,6 +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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -165,14 +167,6 @@ public class Collection implements Serializable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Collection=");
sb.append("[id=").append(id);
sb.append("],[title=").append(title);
sb.append("],[name=").append(name);
sb.append("],[posterPath=").append(posterPath);
sb.append("],[backdropPath=").append(backdropPath);
sb.append("],[releaseDate=").append(releaseDate);
sb.append("]]");
return sb.toString();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -1,124 +1,129 @@
/*
* 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();
}
}
/*
* 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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
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("overview")
private String overview;
@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 String getOverview() {
return overview;
}
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 setOverview(String overview) {
this.overview = overview;
}
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() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -22,6 +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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -128,6 +130,6 @@ public class Company implements Serializable {
@Override
public String toString() {
return "Company{" + "companyId=" + companyId + ", name=" + name + ", description=" + description + ", headquarters=" + headquarters + ", homepage=" + homepage + ", logoPath=" + logoPath + ", parentCompany=" + parentCompany + '}';
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -0,0 +1,262 @@
/*
* 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;private either version 3 of the License;private or
* any later version.
*
* TheMovieDB API is distributed in the hope that it will be useful;private
* 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;private see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model;
import java.util.HashMap;
import java.util.Map;
import static com.omertron.themoviedbapi.tools.ApiUrl.*;
import org.apache.commons.lang3.StringUtils;
/**
* Generate a discover object for use in the MovieDbApi
*
* This allows you to just add the search components you are concerned with
*
* @author stuart.boston
*/
public class Discover {
private Map<String, String> params = new HashMap<String, String>();
private static final String PARAM_PRIMARY_RELEASE_YEAR = "primary_release_year=";
private static final String PARAM_VOTE_COUNT_GTE = "vote_count.gte=";
private static final String PARAM_VOTE_AVERAGE_GTE = "vote_average.gte=";
private static final String PARAM_WITH_GENRES = "with_genres=";
private static final String PARAM_RELEASE_DATE_GTE = "release_date.gte=";
private static final String PARAM_RELEASE_DATE_LTE = "release_date.lte=";
private static final String PARAM_CERTIFICATION_COUNTRY = "certification_country=";
private static final String PARAM_CERTIFICATION_LTE = "certification.lte=";
private static final String PARAM_WITH_COMPANIES = "with_companies=";
private static final String PARAM_SORT_BY = "sort_by=";
private static final int YEAR_MIN = 1900;
private static final int YEAR_MAX = 2100;
/**
* Get the parameters
*
* This will be used to construct the URL in the API
*
* @return
*/
public Map<String, String> getParams() {
return params;
}
/**
* Minimum value is 1 if included.
*
* @param page
*/
public Discover page(int page) {
if (page > 0) {
params.put(PARAM_PAGE, String.valueOf(page));
}
return this;
}
/**
* ISO 639-1 code
*
* @param language
*/
public Discover language(String language) {
if (StringUtils.isNotBlank(language)) {
params.put(PARAM_LANGUAGE, language);
}
return this;
}
/**
* Available options are <br>
* vote_average.desc<br>
* vote_average.asc<br>
* release_date.desc<br>
* release_date.asc<br>
* popularity.desc<br>
* popularity.asc
*
* @param sortBy
*/
public Discover sortBy(String sortBy) {
if (StringUtils.isNotBlank(sortBy)) {
params.put(PARAM_SORT_BY, sortBy);
}
return this;
}
/**
* Toggle the inclusion of adult titles
*
* @param includeAdult
*/
public Discover includeAdult(boolean includeAdult) {
params.put(PARAM_ADULT, String.valueOf(includeAdult));
return this;
}
/**
* Filter the results release dates to matches that include this value.
*
* @param year
*/
public Discover year(int year) {
if (checkYear(year)) {
params.put(PARAM_YEAR, String.valueOf(year));
}
return this;
}
/**
* Filter the results so that only the primary release date year has this value
*
* @param primaryReleaseYear
*/
public Discover primaryReleaseYear(int primaryReleaseYear) {
if (checkYear(primaryReleaseYear)) {
params.put(PARAM_PRIMARY_RELEASE_YEAR, String.valueOf(primaryReleaseYear));
}
return this;
}
/**
* Only include movies that are equal to, or have a vote count higher than this value
*
* @param voteCountGte
*/
public Discover voteCountGte(int voteCountGte) {
if (voteCountGte > 0) {
params.put(PARAM_VOTE_COUNT_GTE, String.valueOf(voteCountGte));
}
return this;
}
/**
* Only include movies that are equal to, or have a higher average rating than this value
*
* @param voteAverageGte
*/
public Discover voteAverageGte(float voteAverageGte) {
if (voteAverageGte > 0) {
params.put(PARAM_VOTE_AVERAGE_GTE, String.valueOf(voteAverageGte));
}
return this;
}
/**
* Only include movies with the specified genres.
*
* Expected value is an integer (the id of a genre).
*
* Multiple values can be specified.
*
* Comma separated indicates an 'AND' query, while a pipe (|) separated value indicates an 'OR'
*
* @param withGenres
*/
public Discover withGenres(String withGenres) {
if (StringUtils.isNotBlank(withGenres)) {
params.put(PARAM_WITH_GENRES, withGenres);
}
return this;
}
/**
* The minimum release to include.
*
* Expected format is YYYY-MM-DD.
*
* @param releaseDateGte
*/
public Discover releaseDateGte(String releaseDateGte) {
if (StringUtils.isNotBlank(releaseDateGte)) {
params.put(PARAM_RELEASE_DATE_GTE, releaseDateGte);
}
return this;
}
/**
* The maximum release to include.
*
* Expected format is YYYY-MM-DD.
*
* @param releaseDateLte
*/
public Discover releaseDateLte(String releaseDateLte) {
if (StringUtils.isNotBlank(releaseDateLte)) {
params.put(PARAM_RELEASE_DATE_LTE, releaseDateLte);
}
return this;
}
/**
* Only include movies with certifications for a specific country.
*
* When this value is specified, 'certificationLte' is required.
*
* A ISO 3166-1 is expected
*
* @param certificationCountry
*/
public Discover certificationCountry(String certificationCountry) {
if (StringUtils.isNotBlank(certificationCountry)) {
params.put(PARAM_CERTIFICATION_COUNTRY, certificationCountry);
}
return this;
}
/**
* Only include movies with this certification and lower.
*
* Expected value is a valid certification for the specified 'certificationCountry'.
*
* @param certificationLte
*/
public Discover certificationLte(String certificationLte) {
if (StringUtils.isNotBlank(certificationLte)) {
params.put(PARAM_CERTIFICATION_LTE, certificationLte);
}
return this;
}
/**
* Filter movies to include a specific company.
*
* Expected value is an integer (the id of a company).
*
* They can be comma separated to indicate an 'AND' query
*
* @param withCompanies
*/
public Discover withCompanies(String withCompanies) {
if (StringUtils.isNotBlank(withCompanies)) {
params.put(PARAM_WITH_COMPANIES, withCompanies);
}
return this;
}
/**
* check the year is between the min and max
*
* @param year
* @return
*/
private boolean checkYear(int year) {
return (year >= YEAR_MIN && year <= YEAR_MAX);
}
}
@@ -23,6 +23,8 @@ 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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -108,10 +110,6 @@ public class Genre implements Serializable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Genre=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -1,82 +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.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());
}
}
/*
* 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.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JobDepartment {
private static final long serialVersionUID = 1L;
// Logger
private static final Logger LOG = LoggerFactory.getLogger(JobDepartment.class);
// Properties
@JsonProperty("department")
private String department;
@JsonProperty("job_list")
private List<String> jobs;
//<editor-fold defaultstate="collapsed" desc="Getters">
public String getDepartment() {
return department;
}
public List<String> getJobs() {
return jobs;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setters">
public void setDepartment(String department) {
this.department = department;
}
public void setJobs(List<String> jobs) {
this.jobs = jobs;
}
//</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 ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -23,6 +23,8 @@ 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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -109,10 +111,6 @@ public class Keyword implements Serializable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Keyword=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -22,6 +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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -56,6 +58,10 @@ public class KeywordMovie implements Serializable {
private float voteAverage;
@JsonProperty("vote_count")
private double voteCount;
@JsonProperty("adult")
private boolean adult;
@JsonProperty("popularity")
private float popularity;
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public static long getSerialVersionUID() {
@@ -93,6 +99,14 @@ public class KeywordMovie implements Serializable {
public double getVoteCount() {
return voteCount;
}
public boolean isAdult() {
return adult;
}
public float getPopularity() {
return popularity;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
@@ -127,6 +141,14 @@ public class KeywordMovie implements Serializable {
public void setVoteCount(double voteCount) {
this.voteCount = voteCount;
}
public void setAdult(boolean adult) {
this.adult = adult;
}
public void setPopularity(float popularity) {
this.popularity = popularity;
}
// </editor-fold>
/**
@@ -143,4 +165,8 @@ public class KeywordMovie implements Serializable {
LOG.trace(sb.toString());
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -23,6 +23,8 @@ 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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -108,10 +110,6 @@ public class Language implements Serializable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Language=");
sb.append("isoCode=").append(isoCode);
sb.append(", name=").append(name);
sb.append("]]");
return sb.toString();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -1,354 +1,452 @@
/*
* 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();
}
}
/*
* 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.omertron.themoviedbapi.wrapper.WrapperAlternativeTitles;
import com.omertron.themoviedbapi.wrapper.WrapperImages;
import com.omertron.themoviedbapi.wrapper.WrapperMovie;
import com.omertron.themoviedbapi.wrapper.WrapperMovieCasts;
import com.omertron.themoviedbapi.wrapper.WrapperMovieKeywords;
import com.omertron.themoviedbapi.wrapper.WrapperMovieList;
import com.omertron.themoviedbapi.wrapper.WrapperReleaseInfo;
import com.omertron.themoviedbapi.wrapper.WrapperReviews;
import com.omertron.themoviedbapi.wrapper.WrapperTrailers;
import com.omertron.themoviedbapi.wrapper.WrapperTranslations;
import java.io.Serializable;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
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;
// AppendToResponse Properties
@JsonProperty("alternative_titles")
private WrapperAlternativeTitles alternativeTitles;
@JsonProperty("casts")
private WrapperMovieCasts casts;
@JsonProperty("images")
private WrapperImages images;
@JsonProperty("keywords")
private WrapperMovieKeywords keywords;
@JsonProperty("releases")
private WrapperReleaseInfo releases;
@JsonProperty("trailers")
private WrapperTrailers trailers;
@JsonProperty("translations")
private WrapperTranslations translations;
@JsonProperty("similar_movies")
private WrapperMovie similarMovies;
@JsonProperty("reviews")
private WrapperReviews reviews;
@JsonProperty("lists")
private WrapperMovieList lists;
// <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>
//<editor-fold defaultstate="collapsed" desc="AppendToResponse Getters">
public List<AlternativeTitle> getAlternativeTitles() {
return alternativeTitles.getTitles();
}
public List<PersonCast> getCast() {
return casts.getCast();
}
public List<PersonCrew> getCrew() {
return casts.getCrew();
}
public List<Artwork> getImages() {
return images.getAll();
}
public List<Keyword> getKeywords() {
return keywords.getKeywords();
}
public List<ReleaseInfo> getReleases() {
return releases.getCountries();
}
public List<Trailer> getTrailers() {
return trailers.getAll();
}
public List<Translation> getTranslations() {
return translations.getTranslations();
}
public List<MovieDb> getSimilarMovies() {
return similarMovies.getMovies();
}
public List<MovieList> getLists() {
return lists.getMovieList();
}
public List<Reviews> getReviews() {
return reviews.getReviews();
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="AppendToResponse Setters">
public void setAlternativeTitles(WrapperAlternativeTitles alternativeTitles) {
this.alternativeTitles = alternativeTitles;
}
public void setCasts(WrapperMovieCasts casts) {
this.casts = casts;
}
public void setImages(WrapperImages images) {
this.images = images;
}
public void setKeywords(WrapperMovieKeywords keywords) {
this.keywords = keywords;
}
public void setReleases(WrapperReleaseInfo releases) {
this.releases = releases;
}
public void setTrailers(WrapperTrailers trailers) {
this.trailers = trailers;
}
public void setTranslations(WrapperTranslations translations) {
this.translations = translations;
}
public void setSimilarMovies(WrapperMovie similarMovies) {
this.similarMovies = similarMovies;
}
public void setLists(WrapperMovieList lists) {
this.lists = lists;
}
public void setReviews(WrapperReviews reviews) {
this.reviews = reviews;
}
//</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() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -23,11 +23,14 @@ import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Collections;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Wrapper for the MovieDbList function
*
* @author stuart.boston
*/
public class MovieDbList {
@@ -148,4 +151,8 @@ public class MovieDbList {
LOG.trace(sb.toString());
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -22,6 +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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -141,6 +143,6 @@ public class MovieList implements Serializable {
@Override
public String toString() {
return "MovieList{" + "description=" + description + ", favoriteCount=" + favoriteCount + ", id=" + id + ", itemCount=" + itemCount + ", language=" + language + ", name=" + name + ", posterPath=" + posterPath + '}';
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -321,23 +323,6 @@ public class Person implements Serializable {
@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();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -22,6 +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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -161,13 +163,6 @@ public class PersonCast implements Serializable {
@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();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -22,6 +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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -161,18 +163,6 @@ public class PersonCredit implements Serializable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[PersonCredit=");
sb.append("[movieId=").append(movieId);
sb.append("],[personType=").append(personType);
sb.append("],[originalTitle=").append(movieOriginalTitle);
sb.append("],[movieTitle=").append(movieTitle);
sb.append("],[posterPath=").append(posterPath);
sb.append("],[releaseDate=").append(releaseDate);
sb.append("],[character=").append(character);
sb.append("],[department=").append(department);
sb.append("],[job=").append(job);
sb.append("],[adult=").append(adult);
sb.append("]]");
return sb.toString();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -22,6 +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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -146,13 +148,6 @@ public class PersonCrew implements Serializable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[PersonCrew=");
sb.append("id=").append(id);
sb.append("],[department=").append(department);
sb.append("],[job=").append(job);
sb.append("],[name=").append(name);
sb.append("],[profilePath=").append(profilePath);
sb.append("]]");
return sb.toString();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -23,6 +23,8 @@ 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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -109,10 +111,6 @@ public class ProductionCompany implements Serializable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ProductionCompany=");
sb.append("[id=").append(id);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -23,6 +23,8 @@ 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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -109,10 +111,6 @@ public class ProductionCountry implements Serializable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[ProductionCountry=");
sb.append("[isoCode=").append(isoCode);
sb.append("],[name=").append(name);
sb.append("]]");
return sb.toString();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -22,6 +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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -121,11 +123,6 @@ public class ReleaseInfo implements Serializable {
@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();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -1,122 +1,108 @@
/*
* 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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ChangeItem {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(MovieChanges.class);
/*
* Properties
*/
@JsonProperty("id")
private String id;
@JsonProperty("action")
private String action;
@JsonProperty("time")
private String time;
@JsonProperty("value")
private ChangeValue value;
@JsonProperty("original_value")
private ChangeValue originalValue;
@JsonProperty("iso_639_1")
private String language;
//<editor-fold defaultstate="collapsed" desc="Getter Methods">
public String getId() {
return id;
}
public String getAction() {
return action;
}
public String getTime() {
return time;
}
public ChangeValue getValue() {
return value;
}
public ChangeValue getOriginalValue() {
return originalValue;
}
public String getLanguage() {
return language;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter Methods">
public void setId(String id) {
this.id = id;
}
public void setAction(String action) {
this.action = action;
}
public void setTime(String time) {
this.time = time;
}
public void setValue(ChangeValue value) {
this.value = value;
}
public void setOriginalValue(ChangeValue originalValue) {
this.originalValue = originalValue;
}
public void setLanguage(String language) {
this.language = language;
}
//</editor-fold>
@Override
public String toString() {
return "ChangeItem{" + "id=" + id + ", action=" + action + ", time=" + time + ", value=" + value + '}';
}
/**
* 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());
}
}
/*
* 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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class Reviews implements Serializable {
private static final long serialVersionUID = 1L;
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(Reviews.class);
/*
* Properties
*/
@JsonProperty("id")
private String id;
@JsonProperty("author")
private String author;
@JsonProperty("content")
private String content;
@JsonProperty("url")
private String url;
// <editor-fold defaultstate="collapsed" desc="Getter methods">
public String getId() {
return id;
}
public String getAuthor() {
return author;
}
public String getContent() {
return content;
}
public String getUrl() {
return url;
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Setter methods">
public void setId(String id) {
this.id = id;
}
public void setAuthor(String author) {
this.author = author;
}
public void setContent(String content) {
this.content = content;
}
public void setUrl(String url) {
this.url = url;
}
// </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 ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -22,6 +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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -81,9 +83,6 @@ public class StatusCode implements Serializable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Status Code: ").append(statusCode);
sb.append(", Message: ").append(statusMessage);
return sb.toString();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -24,6 +24,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -195,13 +197,6 @@ public class TmdbConfiguration implements Serializable {
@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();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -21,6 +21,8 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -83,7 +85,7 @@ public class TokenAuthorisation {
@Override
public String toString() {
return "TokenAuthorisation{" + "expires=" + expires + ", requestToken=" + requestToken + ", success=" + success + '}';
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -21,6 +21,8 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -115,6 +117,6 @@ public class TokenSession {
@Override
public String toString() {
return "TokenSession{" + "sessionId=" + sessionId + ", success=" + success + ", statusCode=" + statusCode + ", statusMessage=" + statusMessage + ", guestSessionId=" + guestSessionId + ", expiresAt=" + expiresAt + '}';
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -21,6 +21,8 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import java.io.Serializable;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -132,12 +134,6 @@ public class Trailer implements Serializable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[Trailer=");
sb.append("name=").append(name);
sb.append("],[size=").append(size);
sb.append("],[source=").append(source);
sb.append("],[website=").append(website);
sb.append("]]");
return sb.toString();
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -22,6 +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.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -121,11 +123,6 @@ public class Translation implements Serializable {
@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();
}
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -0,0 +1,105 @@
/*
* 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.results;
import com.omertron.themoviedbapi.wrapper.AbstractWrapper;
import com.omertron.themoviedbapi.wrapper.AbstractWrapperAll;
import com.omertron.themoviedbapi.wrapper.AbstractWrapperId;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* Abstract class to return the results and the id/page info
*
* @author Stuart
*/
public abstract class TmdbResults {
private int id = 0;
private int page = 0;
private int totalPages = 0;
private int totalResults = 0;
//<editor-fold defaultstate="collapsed" desc="Getters">
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="Setters">
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>
public void copyWrapper(AbstractWrapper wrapper) {
// These results have nothing to copy, so this is just a placeholder
}
/**
* Copy the Id from the wrapper
*
* @param wrapper
*/
public void copyWrapper(AbstractWrapperId wrapper) {
this.id = wrapper.getId();
}
/**
* Copy the Id and pages from the wrapper
*
* @param wrapper
*/
public void copyWrapper(AbstractWrapperAll wrapper) {
this.id = wrapper.getId();
this.page = wrapper.getPage();
this.totalPages = wrapper.getTotalPages();
this.totalResults = wrapper.getTotalResults();
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -0,0 +1,50 @@
/*
* 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.results;
import java.util.ArrayList;
import java.util.List;
/**
* List of the results from TheMovieDb
*
* @author Stuart
* @param <T>
*/
public final class TmdbResultsList<T> extends TmdbResults {
private List<T> results;
public TmdbResultsList(List<T> resultList) {
if (resultList != null) {
results = new ArrayList<T>(resultList);
} else {
results = new ArrayList<T>(0);
}
}
public List<T> getResults() {
return results;
}
public void setResults(List<T> results) {
this.results = results;
}
}
@@ -0,0 +1,47 @@
/*
* 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.results;
import java.util.HashMap;
import java.util.Map;
/**
* Map of the results from TheMovieDb
*
* @author Stuart
* @param <K>
* @param <V>
*/
public final class TmdbResultsMap<K, V> extends TmdbResults {
private Map<K, V> results;
public TmdbResultsMap(Map<K, V> resultsMap) {
results = new HashMap<K, V>(resultsMap);
}
public Map<K, V> getResults() {
return results;
}
public void setResults(Map<K, V> results) {
this.results = results;
}
}
@@ -19,13 +19,13 @@
*/
package com.omertron.themoviedbapi.tools;
import com.omertron.themoviedbapi.TheMovieDbApi;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -53,7 +53,7 @@ public class ApiUrl {
/*
* Properties
*/
private TheMovieDbApi tmdb;
private String apiKey;
private String method;
private String submethod;
private Map<String, String> arguments = new HashMap<String, String>();
@@ -67,7 +67,6 @@ public class ApiUrl {
public static final String PARAM_ID = "id=";
public static final String PARAM_LANGUAGE = "language=";
public static final String PARAM_INCLUDE_ALL_MOVIES = "include_all_movies=";
// public static final String PARAM_MOVIE_ID = "movie_id=";
public static final String PARAM_MOVIE_WATCHLIST = "movie_watchlist=";
public static final String PARAM_PAGE = "page=";
public static final String PARAM_QUERY = "query=";
@@ -75,6 +74,9 @@ public class ApiUrl {
public static final String PARAM_TOKEN = "request_token=";
public static final String PARAM_VALUE = "value=";
public static final String PARAM_YEAR = "year=";
public static final String PARAM_START_DATE="start_date=";
public static final String PARAM_END_DATE="end_date=";
private static final String APPEND_TO_RESPONSE = "append_to_response=";
//<editor-fold defaultstate="collapsed" desc="Constructor Methods">
/**
@@ -82,8 +84,8 @@ public class ApiUrl {
*
* @param method
*/
public ApiUrl(TheMovieDbApi tmdb, String method) {
this.tmdb = tmdb;
public ApiUrl(String apiKey, String method) {
this.apiKey = apiKey;
this.method = method;
this.submethod = DEFAULT_STRING;
}
@@ -94,8 +96,8 @@ public class ApiUrl {
* @param method
* @param submethod
*/
public ApiUrl(TheMovieDbApi tmdb, String method, String submethod) {
this.tmdb = tmdb;
public ApiUrl(String apiKey, String method, String submethod) {
this.apiKey = apiKey;
this.method = method;
this.submethod = submethod;
}
@@ -113,11 +115,14 @@ public class ApiUrl {
// We have either a queury, or a direct request
if (arguments.containsKey(PARAM_QUERY)) {
// Append the suffix of the API URL
if(StringUtils.endsWith(urlString, "/") && submethod.startsWith("/")) {
urlString.deleteCharAt(urlString.length()-1);
}
urlString.append(submethod);
// Append the key information
urlString.append(DELIMITER_FIRST).append(PARAM_API_KEY);
urlString.append(tmdb.getApiKey());
urlString.append(apiKey);
// Append the search term
urlString.append(DELIMITER_SUBSEQUENT);
@@ -128,11 +133,12 @@ public class ApiUrl {
try {
urlString.append(URLEncoder.encode(query, "UTF-8"));
} catch (UnsupportedEncodingException ex) {
LOG.trace("Unable to encode query: '" + query + "' trying raw.");
LOG.trace("Unable to encode query: '{}' trying raw.", query);
// If we can't encode it, try it raw
urlString.append(query);
}
// Remove the query from the arguments so it is not added later
arguments.remove(PARAM_QUERY);
} else {
// Append the ID if provided
@@ -142,11 +148,14 @@ public class ApiUrl {
}
// Append the suffix of the API URL
if(StringUtils.endsWith(urlString, "/") && submethod.startsWith("/")) {
urlString.deleteCharAt(urlString.length()-1);
}
urlString.append(submethod);
// Append the key information
urlString.append(DELIMITER_FIRST).append(PARAM_API_KEY);
urlString.append(tmdb.getApiKey());
urlString.append(apiKey);
}
for (Map.Entry<String, String> argEntry : arguments.entrySet()) {
@@ -195,6 +204,16 @@ public class ApiUrl {
arguments.put(key, Boolean.toString(value));
}
/**
* Add arguments individually
*
* @param key
* @param value
*/
public void addArgument(String key, float value) {
arguments.put(key, Float.toString(value));
}
/**
* Clear the arguments
*/
@@ -210,4 +229,25 @@ public class ApiUrl {
public void setArguments(Map<String, String> args) {
arguments.putAll(args);
}
/**
* Append any optional parameters to the URL
*
* @param appendToResponse
*/
public void appendToResponse(String[] appendToResponse) {
if (appendToResponse.length > 0) {
StringBuilder sb = new StringBuilder();
boolean first = Boolean.TRUE;
for (String append : appendToResponse) {
if (first) {
first = Boolean.FALSE;
} else {
sb.append(",");
}
sb.append(append);
}
addArgument(APPEND_TO_RESPONSE, sb.toString());
}
}
}
@@ -0,0 +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.JsonAnySetter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class AbstractWrapper {
private Logger log;
public AbstractWrapper(Class classToLog) {
this.log = LoggerFactory.getLogger(classToLog);
}
/**
* Get a list of the enums passed
*
* @param <E>
* @param clz Class of the enum
* @param typeList Array of the enums
* @return
*/
public <E extends Enum<E>> List<E> getTypeList(Class<E> clz, E[] typeList) {
if (typeList.length > 0) {
return new ArrayList<E>(Arrays.asList(typeList));
} else {
return new ArrayList<E>(EnumSet.allOf(clz));
}
}
/**
* 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 ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -1,102 +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.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.slf4j.Logger;
/**
* Base class for the wrappers
*
* @author Stuart
*/
public class WrapperBase {
/*
* Logger - set by 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 logger) {
this.log = 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("'");
log.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.JsonProperty;
/**
* Base class for the wrappers
*
* @author Stuart
*/
public class AbstractWrapperAll extends AbstractWrapperId implements IWrapperId, IWrapperPages {
/*
* Properties
*/
@JsonProperty("page")
private int page;
@JsonProperty("total_pages")
private int totalPages;
@JsonProperty("total_results")
private int totalResults;
public AbstractWrapperAll(Class classToLog) {
super(classToLog);
}
@Override
public int getPage() {
return page;
}
@Override
public int getTotalPages() {
return totalPages;
}
@Override
public int getTotalResults() {
return totalResults;
}
@Override
public void setPage(int page) {
this.page = page;
}
@Override
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
@Override
public void setTotalResults(int totalResults) {
this.totalResults = totalResults;
}
}
@@ -0,0 +1,50 @@
/*
* 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;
/**
* Base class for the wrappers
*
* @author Stuart
*/
public class AbstractWrapperId extends AbstractWrapper implements IWrapperId {
/*
* Properties
*/
@JsonProperty("id")
private int id;
public AbstractWrapperId(Class classToLog) {
super(classToLog);
}
@Override
public int getId() {
return id;
}
@Override
public void setId(int id) {
this.id = id;
}
}
@@ -0,0 +1,27 @@
/*
* 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;
public interface IWrapperId {
int getId();
void setId(int id);
}
@@ -0,0 +1,35 @@
/*
* 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;
public interface IWrapperPages {
int getPage();
void setPage(int page);
int getTotalPages();
void setTotalPages(int totalPages);
int getTotalResults();
void setTotalResults(int totalResults);
}
@@ -1,76 +1,46 @@
/*
* 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());
}
}
/*
* 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.AlternativeTitle;
import java.util.List;
/**
*
* @author Stuart
*/
public class WrapperAlternativeTitles extends AbstractWrapperId {
@JsonProperty("titles")
private List<AlternativeTitle> titles;
public WrapperAlternativeTitles() {
super(WrapperAlternativeTitles.class);
}
public List<AlternativeTitle> getTitles() {
return titles;
}
public void setTitles(List<AlternativeTitle> titles) {
this.titles = titles;
}
}
@@ -1,70 +1,42 @@
/*
* 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.MovieChanges;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
public class WrapperChanges {
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(WrapperChanges.class);
/*
* Properties
*/
@JsonProperty("changes")
private List<MovieChanges> changes;
//<editor-fold defaultstate="collapsed" desc="Getter methods">
public List<MovieChanges> getChanges() {
return changes;
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setChanges(List<MovieChanges> changes) {
this.changes = changes;
}
//</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());
}
}
package com.omertron.themoviedbapi.wrapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.omertron.themoviedbapi.model.ChangeKeyItem;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class WrapperChanges {
@JsonProperty("changes")
private List<ChangeKeyItem> changedItems = new ArrayList<ChangeKeyItem>();
private Map<String, Object> newItems = new HashMap<String, Object>();
public List<ChangeKeyItem> getChangedItems() {
return changedItems;
}
public void setChangedItems(List<ChangeKeyItem> changes) {
this.changedItems = changes;
}
@JsonAnyGetter
public Map<String, Object> getNewItems() {
return this.newItems;
}
@JsonAnySetter
public void setNewItems(String name, Object value) {
this.newItems.put(name, value);
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
@@ -1,50 +1,46 @@
/*
* 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.Collection;
import java.util.List;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
public class WrapperCollection extends WrapperBase {
/*
* Properties
*/
@JsonProperty("results")
private List<Collection> results;
public WrapperCollection() {
super(LoggerFactory.getLogger(WrapperCollection.class));
}
public List<Collection> getResults() {
return results;
}
public void setResults(List<Collection> results) {
this.results = results;
}
}
/*
* 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.Collection;
import java.util.List;
/**
*
* @author stuart.boston
*/
public class WrapperCollection extends AbstractWrapperAll {
@JsonProperty("results")
private List<Collection> results;
public WrapperCollection() {
super(WrapperCollection.class);
}
public List<Collection> getResults() {
return results;
}
public void setResults(List<Collection> results) {
this.results = results;
}
}
@@ -1,50 +1,46 @@
/*
* 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.Company;
import java.util.List;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
public class WrapperCompany extends WrapperBase {
/*
* Properties
*/
@JsonProperty("results")
private List<Company> results;
public WrapperCompany() {
super(LoggerFactory.getLogger(WrapperCompany.class));
}
public List<Company> getResults() {
return results;
}
public void setResults(List<Company> results) {
this.results = results;
}
}
/*
* 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.Company;
import java.util.List;
/**
*
* @author stuart.boston
*/
public class WrapperCompany extends AbstractWrapperAll {
@JsonProperty("results")
private List<Company> results;
public WrapperCompany() {
super(WrapperCompany.class);
}
public List<Company> getResults() {
return results;
}
public void setResults(List<Company> results) {
this.results = results;
}
}
@@ -1,62 +1,46 @@
/*
* 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.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();
}
}
/*
* 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;
/**
*
* @author stuart.boston
*/
public class WrapperCompanyMovies extends AbstractWrapperAll {
@JsonProperty("results")
private List<MovieDb> results;
public WrapperCompanyMovies() {
super(WrapperCompanyMovies.class);
}
public List<MovieDb> getResults() {
return results;
}
public void setResults(List<MovieDb> results) {
this.results = results;
}
}
@@ -1,77 +1,57 @@
/*
* 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.TmdbConfiguration;
import java.util.Collections;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Stuart
*/
public class WrapperConfig {
/*
* Logger
*/
private static final Logger LOG = LoggerFactory.getLogger(WrapperConfig.class);
/*
* Properties
*/
@JsonProperty("images")
private TmdbConfiguration tmdbConfiguration;
@JsonProperty("change_keys")
private List<String> changeKeys = Collections.EMPTY_LIST;
public TmdbConfiguration getTmdbConfiguration() {
return tmdbConfiguration;
}
public void setTmdbConfiguration(TmdbConfiguration tmdbConfiguration) {
this.tmdbConfiguration = tmdbConfiguration;
}
public List<String> getChangeKeys() {
return changeKeys;
}
public void setChangeKeys(List<String> changeKeys) {
this.changeKeys = changeKeys;
}
/**
* 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());
}
}
/*
* 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.TmdbConfiguration;
import java.util.Collections;
import java.util.List;
/**
*
* @author Stuart
*/
public class WrapperConfig extends AbstractWrapper {
@JsonProperty("images")
private TmdbConfiguration tmdbConfiguration;
@JsonProperty("change_keys")
private List<String> changeKeys = Collections.EMPTY_LIST;
public WrapperConfig() {
super(WrapperConfig.class);
}
public TmdbConfiguration getTmdbConfiguration() {
return tmdbConfiguration;
}
public void setTmdbConfiguration(TmdbConfiguration tmdbConfiguration) {
this.tmdbConfiguration = tmdbConfiguration;
}
public List<String> getChangeKeys() {
return changeKeys;
}
public void setChangeKeys(List<String> changeKeys) {
this.changeKeys = changeKeys;
}
}
@@ -1,67 +1,47 @@
/*
* 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());
}
}
/*
* 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.Genre;
import java.util.List;
/**
* Wrapper class for the Genres searches
*
* @author Stuart
*/
public class WrapperGenres extends AbstractWrapper {
@JsonProperty("genres")
private List<Genre> genres;
public WrapperGenres() {
super(WrapperGenres.class);
}
public List<Genre> getGenres() {
return genres;
}
public void setGenres(List<Genre> genres) {
this.genres = genres;
}
}
@@ -1,74 +1,120 @@
/*
* 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.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>
}
/*
* 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 com.omertron.themoviedbapi.model.ArtworkType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
*
* @author Stuart
*/
public class WrapperImages extends AbstractWrapperAll {
@JsonProperty("backdrops")
private List<Artwork> backdrops = Collections.EMPTY_LIST;
@JsonProperty("posters")
private List<Artwork> posters = Collections.EMPTY_LIST;
@JsonProperty("profiles")
private List<Artwork> profiles = Collections.EMPTY_LIST;
public WrapperImages() {
super(WrapperImages.class);
}
public List<Artwork> getBackdrops() {
return backdrops;
}
public List<Artwork> getPosters() {
return posters;
}
public List<Artwork> getProfiles() {
return profiles;
}
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;
}
/**
* Return a list of all the artwork with their types.
*
* Leaving the parameters blank will return all types
*
* @return
*/
public List<Artwork> getAll(ArtworkType... artworkList) {
List<Artwork> artwork = new ArrayList<Artwork>();
List<ArtworkType> types;
if (artworkList.length > 0) {
types = new ArrayList<ArtworkType>(Arrays.asList(artworkList));
} else {
types = new ArrayList<ArtworkType>(Arrays.asList(ArtworkType.values()));
}
// Add all the posters to the list
if (types.contains(ArtworkType.POSTER)) {
updateArtworkType(posters, ArtworkType.POSTER);
artwork.addAll(posters);
}
// Add all the backdrops to the list
if (types.contains(ArtworkType.BACKDROP)) {
updateArtworkType(backdrops, ArtworkType.BACKDROP);
artwork.addAll(backdrops);
}
// Add all the backdrops to the list
if (types.contains(ArtworkType.PROFILE)) {
updateArtworkType(profiles, ArtworkType.PROFILE);
artwork.addAll(profiles);
}
return artwork;
}
/**
* Update the artwork type for the artwork list
*
* @param artworkList
* @param type
*/
private void updateArtworkType(List<Artwork> artworkList, ArtworkType type) {
for (Artwork artwork : artworkList) {
artwork.setArtworkType(type);
}
}
}
@@ -0,0 +1,46 @@
/*
* 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.JobDepartment;
import java.util.List;
/**
*
* @author Stuart
*/
public class WrapperJobList extends AbstractWrapper {
@JsonProperty("jobs")
private List<JobDepartment> jobs;
public WrapperJobList() {
super(WrapperJobList.class);
}
public List<JobDepartment> getJobs() {
return jobs;
}
public void setJobs(List<JobDepartment> jobs) {
this.jobs = jobs;
}
}
@@ -1,50 +1,46 @@
/*
* 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.KeywordMovie;
import java.util.List;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
public class WrapperKeywordMovies extends WrapperBase {
/*
* Properties
*/
@JsonProperty("results")
private List<KeywordMovie> results;
public WrapperKeywordMovies() {
super(LoggerFactory.getLogger(WrapperKeywordMovies.class));
}
public List<KeywordMovie> getResults() {
return results;
}
public void setResults(List<KeywordMovie> results) {
this.results = results;
}
}
/*
* 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.KeywordMovie;
import java.util.List;
/**
*
* @author stuart.boston
*/
public class WrapperKeywordMovies extends AbstractWrapperAll {
@JsonProperty("results")
private List<KeywordMovie> results;
public WrapperKeywordMovies() {
super(WrapperKeywordMovies.class);
}
public List<KeywordMovie> getResults() {
return results;
}
public void setResults(List<KeywordMovie> results) {
this.results = results;
}
}
@@ -1,50 +1,46 @@
/*
* 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.Keyword;
import java.util.List;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
public class WrapperKeywords extends WrapperBase {
/*
* Properties
*/
@JsonProperty("results")
private List<Keyword> results;
public WrapperKeywords() {
super(LoggerFactory.getLogger(WrapperKeywords.class));
}
public List<Keyword> getResults() {
return results;
}
public void setResults(List<Keyword> results) {
this.results = results;
}
}
/*
* 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.Keyword;
import java.util.List;
/**
*
* @author stuart.boston
*/
public class WrapperKeywords extends AbstractWrapperAll {
@JsonProperty("results")
private List<Keyword> results;
public WrapperKeywords() {
super(WrapperKeywords.class);
}
public List<Keyword> getResults() {
return results;
}
public void setResults(List<Keyword> results) {
this.results = results;
}
}
@@ -1,62 +1,46 @@
/*
* 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.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();
}
}
/*
* 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;
/**
*
* @author stuart.boston
*/
public class WrapperMovie extends AbstractWrapperAll {
@JsonProperty("results")
private List<MovieDb> movies;
public WrapperMovie() {
super(WrapperMovie.class);
}
public List<MovieDb> getMovies() {
return movies;
}
public void setMovies(List<MovieDb> movies) {
this.movies = movies;
}
}
@@ -1,91 +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.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());
}
}
/*
* 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.Person;
import com.omertron.themoviedbapi.model.PersonCast;
import com.omertron.themoviedbapi.model.PersonCrew;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Stuart
*/
public class WrapperMovieCasts extends AbstractWrapperId {
@JsonProperty("cast")
private List<PersonCast> cast;
@JsonProperty("crew")
private List<PersonCrew> crew;
public WrapperMovieCasts() {
super(WrapperMovieCasts.class);
}
public List<PersonCast> getCast() {
return cast;
}
public List<PersonCrew> getCrew() {
return crew;
}
public void setCast(List<PersonCast> cast) {
this.cast = cast;
}
public void setCrew(List<PersonCrew> crew) {
this.crew = crew;
}
public List<Person> getAll() {
List<Person> people = new ArrayList<Person>();
// Add a cast member
for (PersonCast member : cast) {
Person person = new Person();
person.addCast(member.getId(), member.getName(), member.getProfilePath(), member.getCharacter(), member.getOrder());
people.add(person);
}
// Add a crew member
for (PersonCrew member : crew) {
Person person = new Person();
person.addCrew(member.getId(), member.getName(), member.getProfilePath(), member.getDepartment(), member.getJob());
people.add(person);
}
return people;
}
}
@@ -1,80 +1,46 @@
/*
* 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());
}
}
/*
* 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.Keyword;
import java.util.List;
/**
*
* @author Stuart
*/
public class WrapperMovieKeywords extends AbstractWrapperId {
@JsonProperty("keywords")
private List<Keyword> keywords;
public WrapperMovieKeywords() {
super(WrapperMovieKeywords.class);
}
public List<Keyword> getKeywords() {
return keywords;
}
public void setKeywords(List<Keyword> keywords) {
this.keywords = keywords;
}
}
@@ -1,50 +1,46 @@
/*
* 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.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;
}
}
/*
* 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;
/**
*
* @author Stuart
*/
public class WrapperMovieList extends AbstractWrapperAll {
@JsonProperty("results")
private List<MovieList> movieList;
public WrapperMovieList() {
super(WrapperMovieList.class);
}
public List<MovieList> getMovieList() {
return movieList;
}
public void setMovieList(List<MovieList> movieList) {
this.movieList = movieList;
}
}
@@ -1,50 +1,46 @@
/*
* 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.Person;
import java.util.List;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
public class WrapperPerson extends WrapperBase {
/*
* Properties
*/
@JsonProperty("results")
private List<Person> results;
public WrapperPerson() {
super(LoggerFactory.getLogger(WrapperPerson.class));
}
public List<Person> getResults() {
return results;
}
public void setResults(List<Person> results) {
this.results = results;
}
}
/*
* 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.Person;
import java.util.List;
/**
*
* @author stuart.boston
*/
public class WrapperPerson extends AbstractWrapperAll {
@JsonProperty("results")
private List<Person> results;
public WrapperPerson() {
super(WrapperPerson.class);
}
public List<Person> getResults() {
return results;
}
public void setResults(List<Person> results) {
this.results = results;
}
}
@@ -1,60 +1,81 @@
/*
* 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.PersonCredit;
import java.util.List;
import org.slf4j.LoggerFactory;
/**
*
* @author stuart.boston
*/
public class WrapperPersonCredits extends WrapperBase {
/*
* Properties
*/
@JsonProperty("cast")
private List<PersonCredit> cast;
@JsonProperty("crew")
private List<PersonCredit> crew;
public WrapperPersonCredits() {
super(LoggerFactory.getLogger(WrapperMovieCasts.class));
}
public List<PersonCredit> getCast() {
return cast;
}
public void setCast(List<PersonCredit> cast) {
this.cast = cast;
}
public List<PersonCredit> getCrew() {
return crew;
}
public void setCrew(List<PersonCredit> crew) {
this.crew = crew;
}
}
/*
* 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.PersonCredit;
import com.omertron.themoviedbapi.model.PersonType;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author stuart.boston
*/
public class WrapperPersonCredits extends AbstractWrapperAll {
@JsonProperty("cast")
private List<PersonCredit> cast;
@JsonProperty("crew")
private List<PersonCredit> crew;
public WrapperPersonCredits() {
super(WrapperMovieCasts.class);
}
public List<PersonCredit> getCast() {
return cast;
}
public void setCast(List<PersonCredit> cast) {
this.cast = cast;
}
public List<PersonCredit> getCrew() {
return crew;
}
public void setCrew(List<PersonCredit> crew) {
this.crew = crew;
}
public List<PersonCredit> getAll(PersonType... typeList) {
List<PersonCredit> personCredits = new ArrayList<PersonCredit>();
List<PersonType> types = getTypeList(PersonType.class, typeList);
// Add a cast member
if (types.contains(PersonType.CAST)) {
for (PersonCredit member : cast) {
member.setPersonType(PersonType.CAST);
personCredits.add(member);
}
}
// Add a crew member
if (types.contains(PersonType.CREW)) {
for (PersonCredit member : crew) {
member.setPersonType(PersonType.CREW);
personCredits.add(member);
}
}
return personCredits;
}
}
@@ -0,0 +1,46 @@
/*
* 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.Person;
import java.util.List;
/**
*
* @author Stuart
*/
public class WrapperPersonList extends AbstractWrapperAll {
@JsonProperty("results")
private List<Person> personList;
public WrapperPersonList() {
super(WrapperPersonList.class);
}
public List<Person> getPersonList() {
return personList;
}
public void setPersonList(List<Person> personList) {
this.personList = personList;
}
}
@@ -1,80 +1,46 @@
/*
* 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());
}
}
/*
* 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.ReleaseInfo;
import java.util.List;
/**
*
* @author Stuart
*/
public class WrapperReleaseInfo extends AbstractWrapperId {
@JsonProperty("countries")
private List<ReleaseInfo> countries;
public WrapperReleaseInfo() {
super(WrapperReleaseInfo.class);
}
public List<ReleaseInfo> getCountries() {
return countries;
}
public void setCountries(List<ReleaseInfo> countries) {
this.countries = countries;
}
}
@@ -0,0 +1,46 @@
/*
* 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.Reviews;
import java.util.List;
/**
*
* @author stuart.boston
*/
public class WrapperReviews extends AbstractWrapperAll {
@JsonProperty("results")
private List<Reviews> reviews;
public WrapperReviews() {
super(WrapperReviews.class);
}
public List<Reviews> getReviews() {
return reviews;
}
public void setReviews(List<Reviews> reviews) {
this.reviews = reviews;
}
}
@@ -1,90 +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.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());
}
}
/*
* 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.Trailer;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Stuart
*/
public class WrapperTrailers extends AbstractWrapperId {
@JsonProperty("quicktime")
private List<Trailer> quicktime;
@JsonProperty("youtube")
private List<Trailer> youtube;
public WrapperTrailers() {
super(WrapperTrailers.class);
}
public List<Trailer> getQuicktime() {
return quicktime;
}
public List<Trailer> getYoutube() {
return youtube;
}
public void setQuicktime(List<Trailer> quicktime) {
this.quicktime = quicktime;
}
public void setYoutube(List<Trailer> youtube) {
this.youtube = youtube;
}
/**
* Get a combined list of the trailers with their source website
*
* @return
*/
public List<Trailer> getAll() {
List<Trailer> trailers = new ArrayList<Trailer>();
// Add the trailer to the return list along with it's source
for (Trailer trailer : quicktime) {
trailer.setWebsite(Trailer.WEBSITE_QUICKTIME);
trailers.add(trailer);
}
// Add the trailer to the return list along with it's source
for (Trailer trailer : youtube) {
trailer.setWebsite(Trailer.WEBSITE_YOUTUBE);
trailers.add(trailer);
}
return trailers;
}
}
@@ -1,80 +1,46 @@
/*
* 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());
}
}
/*
* 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.Translation;
import java.util.List;
/**
*
* @author Stuart
*/
public class WrapperTranslations extends AbstractWrapperId {
@JsonProperty("translations")
private List<Translation> translations;
public WrapperTranslations() {
super(WrapperTranslations.class);
}
public void setTranslations(List<Translation> translations) {
this.translations = translations;
}
public List<Translation> getTranslations() {
return translations;
}
}
+36 -36
View File
@@ -1,39 +1,39 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>bin</id>
<formats>
<format>${distribution.format}</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<!-- add version.txt file -->
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>version.txt</include>
</includes>
</fileSet>
<!-- add readme.txt file -->
<fileSet>
<directory>${basedir}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>readme.txt</include>
</includes>
</fileSet>
<!-- add jar files -->
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>**/*.jar</include>
</includes>
</fileSet>
</fileSets>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>bin</id>
<formats>
<format>${distribution.format}</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<!-- add version.txt file -->
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>version.txt</include>
</includes>
</fileSet>
<!-- add readme.txt file -->
<fileSet>
<directory>${basedir}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<!-- add jar files -->
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>**/*.jar</include>
</includes>
</fileSet>
</fileSets>
</assembly>
File diff suppressed because it is too large Load Diff