Compare commits
114 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 34b337aecd | |||
| 3155555d7a | |||
| 92c6de7426 | |||
| 252a6abab2 | |||
| 07b06455cf | |||
| c02ae50bff | |||
| bf132d7c72 | |||
| 9667a34a01 | |||
| efeae0de0b | |||
| 963dceb6bd | |||
| 695077a1d7 | |||
| 2de5728b3a | |||
| 6733bb6191 | |||
| 71178f21cd | |||
| a0a6a62dbe | |||
| 119a51c8e8 | |||
| 240110848a | |||
| 4f89f03b7f | |||
| 33daddb40e | |||
| 4203dc55a5 | |||
| 998eb06b69 | |||
| 71fa47b48f | |||
| 67bb8d21bd | |||
| d6542d0676 | |||
| 02b03c5c58 | |||
| eb9e9930e1 | |||
| dd82c0d906 | |||
| e184077f9d | |||
| a7a099ac0c | |||
| 3a1251777e | |||
| 8a3af38b0c | |||
| 3104588272 | |||
| 95ff0f0119 | |||
| c3bd8efbf9 | |||
| 09a3fb5ffe | |||
| ce06aacec9 | |||
| ec9c4dd45c | |||
| 0940c7ac38 | |||
| ca9f3248b7 | |||
| b91dac2c9d | |||
| c5a1a85a2a | |||
| 9ab81018dd | |||
| 6eec791933 | |||
| 74fac5636a | |||
| 3f1c359a9f | |||
| 0c455accb5 | |||
| ca4fc59a80 | |||
| 799d6d6fd5 | |||
| 39465e1ba2 | |||
| c208b62384 | |||
| e83d947dfe | |||
| bab9c80781 | |||
| 45515869c6 | |||
| 11f18ce3d8 | |||
| a9e22f4d75 | |||
| 1d977f9d7b | |||
| 96aa13bd70 | |||
| 84e08a93e2 | |||
| 2dc61738c8 | |||
| b0c998b984 | |||
| f506be70ea | |||
| 42ff59d4ba | |||
| 302e47b496 | |||
| f0499bba01 | |||
| 95a0613cb0 | |||
| eb396be02e | |||
| 80177ff9c7 | |||
| 66de073677 | |||
| cf667fa69e | |||
| 525657e6f6 | |||
| f0faafe702 | |||
| c7b37121ca | |||
| 2c7095908b | |||
| 012d694d78 | |||
| cbc2121a87 | |||
| d1e1454134 | |||
| 80414b7c2a | |||
| 3bfbc1c0a7 | |||
| 463032bc05 | |||
| c04f330d54 | |||
| e95b76c44a | |||
| d8e56616e8 | |||
| a47c55ee7e | |||
| 4134594de5 | |||
| 64ca72c182 | |||
| d21bf07f1d | |||
| b5b84cc962 | |||
| 2837424c09 | |||
| c8310935aa | |||
| 50171a7da5 | |||
| f512fc0754 | |||
| 06da84c2ac | |||
| c3569f0140 | |||
| 4f9d74c9f7 | |||
| 0aab56a044 | |||
| 87f973955e | |||
| 64e88fa9f3 | |||
| fb0e14cd21 | |||
| 8451a4630b | |||
| e00d9357e2 | |||
| 212143b18d | |||
| c9f85bab6d | |||
| 4ec54425f3 | |||
| 00b538efb1 | |||
| b16d452114 | |||
| a83c75070d | |||
| 178b49c413 | |||
| 55601a0698 | |||
| a874297106 | |||
| eff654fd61 | |||
| 63afef71a4 | |||
| 1b180f9e28 | |||
| cfc215cd74 | |||
| 5fefa68352 |
+5
-5
@@ -10,13 +10,13 @@
|
|||||||
*.dbproj merge=union
|
*.dbproj merge=union
|
||||||
|
|
||||||
# Standard to msysgit
|
# Standard to msysgit
|
||||||
*.doc diff=astextplain
|
*.doc diff=astextplain
|
||||||
*.DOC diff=astextplain
|
*.DOC diff=astextplain
|
||||||
*.docx diff=astextplain
|
*.docx diff=astextplain
|
||||||
*.DOCX diff=astextplain
|
*.DOCX diff=astextplain
|
||||||
*.dot diff=astextplain
|
*.dot diff=astextplain
|
||||||
*.DOT diff=astextplain
|
*.DOT diff=astextplain
|
||||||
*.pdf diff=astextplain
|
*.pdf diff=astextplain
|
||||||
*.PDF diff=astextplain
|
*.PDF diff=astextplain
|
||||||
*.rtf diff=astextplain
|
*.rtf diff=astextplain
|
||||||
*.RTF diff=astextplain
|
*.RTF diff=astextplain
|
||||||
|
|||||||
@@ -12,3 +12,6 @@ testing.properties
|
|||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
/nbproject/
|
||||||
|
.idea
|
||||||
|
*.iml
|
||||||
|
|||||||
@@ -8,5 +8,6 @@ import java.lang.annotation.Target;
|
|||||||
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
|
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface JsonProperty {
|
public @interface JsonProperty {
|
||||||
String value() default "";
|
|
||||||
|
String value() default "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ import java.lang.annotation.Target;
|
|||||||
@Target(ElementType.TYPE)
|
@Target(ElementType.TYPE)
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface JsonRootName {
|
public @interface JsonRootName {
|
||||||
String value() default "";
|
String value() default "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,59 +11,56 @@ import org.json.JSONObject;
|
|||||||
|
|
||||||
public class ObjectMapper {
|
public class ObjectMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This takes a JSON string and creates (and populates) an object of the given class
|
* This takes a JSON string and creates (and populates) an object of the
|
||||||
* with the data from that JSON string. It mimics the method signature of the jackson
|
* given class with the data from that JSON string. It mimics the method
|
||||||
* JSON API, so that we don't have to import the jackson library into this application.
|
* signature of the jackson JSON API, so that we don't have to import the
|
||||||
*
|
* jackson library into this application.
|
||||||
* @param jsonString The JSON string to parse.
|
*
|
||||||
* @param objClass The class of object we want to create.
|
* @param jsonString The JSON string to parse.
|
||||||
* @return The instantiation of that class, populated with data from the JSON object.
|
* @param objClass The class of object we want to create.
|
||||||
* @throws IOException If there was any kind of issue.
|
* @return The instantiation of that class, populated with data from the
|
||||||
*/
|
* JSON object.
|
||||||
public <T> T readValue(String jsonString, Class<T> objClass) throws IOException {
|
* @throws IOException If there was any kind of issue.
|
||||||
try {
|
*/
|
||||||
return readValue(new JSONObject(jsonString), objClass);
|
public <T> T readValue(String jsonString, Class<T> objClass) throws IOException {
|
||||||
}
|
try {
|
||||||
catch (IOException ioe) {
|
return readValue(new JSONObject(jsonString), objClass);
|
||||||
throw ioe;
|
} catch (IOException ioe) {
|
||||||
}
|
throw ioe;
|
||||||
catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new IOException(e);
|
throw new IOException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public <T, R> T readValue(JSONObject json, Class<T> objClass) throws IOException {
|
public <T, R> T readValue(JSONObject json, Class<T> objClass) throws IOException {
|
||||||
try {
|
try {
|
||||||
//TODO Iterate through json object values and call the JsonAnySetter method on the unknown ones.
|
//TODO Iterate through json object values and call the JsonAnySetter method on the unknown ones.
|
||||||
T obj = objClass.newInstance();
|
T obj = objClass.newInstance();
|
||||||
for (Field f : objClass.getFields()) {
|
for (Field f : objClass.getFields()) {
|
||||||
Annotation a = f.getAnnotation(JsonProperty.class);
|
Annotation a = f.getAnnotation(JsonProperty.class);
|
||||||
if (List.class.equals(f.getType()) && (json.optJSONArray(((JsonProperty) a).value()) != null)) { // It's a list.
|
if (List.class.equals(f.getType()) && (json.optJSONArray(((JsonProperty) a).value()) != null)) { // It's a list.
|
||||||
JSONArray jsonArray = json.optJSONArray(((JsonProperty) a).value());
|
JSONArray jsonArray = json.optJSONArray(((JsonProperty) a).value());
|
||||||
ParameterizedType listType = (ParameterizedType) f.getGenericType();
|
ParameterizedType listType = (ParameterizedType) f.getGenericType();
|
||||||
Class<?> subObj = (Class<?>) listType.getActualTypeArguments()[0];
|
Class<?> subObj = (Class<?>) listType.getActualTypeArguments()[0];
|
||||||
List<R> subObjList = ((Class<List<R>>) f.getType()).newInstance();
|
List<R> subObjList = ((Class<List<R>>) f.getType()).newInstance();
|
||||||
for (int i = 0; i < jsonArray.length(); i++) {
|
for (int i = 0; i < jsonArray.length(); i++) {
|
||||||
subObjList.add((R) readValue(jsonArray.getJSONObject(i), subObj));
|
subObjList.add((R) readValue(jsonArray.getJSONObject(i), subObj));
|
||||||
}
|
}
|
||||||
f.set(obj, subObjList);
|
f.set(obj, subObjList);
|
||||||
}
|
} else if (a != null) {
|
||||||
else if (a != null) {
|
f.set(obj, json.opt(((JsonProperty) a).value()));
|
||||||
f.set(obj, json.opt(((JsonProperty) a).value()));
|
}
|
||||||
}
|
}
|
||||||
}
|
return obj;
|
||||||
return obj;
|
} catch (IOException ioe) {
|
||||||
}
|
throw ioe;
|
||||||
catch (IOException ioe) {
|
} catch (Exception e) {
|
||||||
throw ioe;
|
e.printStackTrace();
|
||||||
}
|
throw new IOException(e);
|
||||||
catch (Exception e) {
|
}
|
||||||
e.printStackTrace();
|
}
|
||||||
throw new IOException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,13 +5,10 @@ Author: Stuart Boston (Omertron AT Gmail DOT com)
|
|||||||
|
|
||||||
This API uses the [TheMovieDB.org API](http://api.themoviedb.org/)
|
This API uses the [TheMovieDB.org API](http://api.themoviedb.org/)
|
||||||
|
|
||||||
Originally written for use by Yet Another Movie Jukebox [(YAMJ)](http://code.google.com/p/moviejukebox/)
|
Originally written for use by YetAnotherMovieJukebox ([YAMJv2](https://github.com/YAMJ/yamj-v2) & [YAMJv3](https://github.com/YAMJ/yamj-v3)), but anyone can feel free to use it for other projects as well.
|
||||||
|
|
||||||
But anyone can use it for other projects as well.
|
[](http://jenkins.omertron.com/job/API-TheMovieDb)
|
||||||
|
|
||||||
[](https://flattr.com/submit/auto?user_id=Omertron&url=https://github.com/Omertron/api-themoviedb&title=TheMovieDB API&language=&tags=github&category=software)
|
|
||||||
|
|
||||||
[](https://bitdeli.com/free "Bitdeli Badge")
|
|
||||||
***
|
***
|
||||||
|
|
||||||
TMDB TV Support
|
TMDB TV Support
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<groupId>com.omertron</groupId>
|
<groupId>com.omertron</groupId>
|
||||||
<artifactId>themoviedbapi</artifactId>
|
<artifactId>themoviedbapi</artifactId>
|
||||||
<version>4.0</version>
|
<version>4.4-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>API-The MovieDB</name>
|
<name>API-The MovieDB</name>
|
||||||
@@ -71,8 +71,14 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<distribution.format>zip</distribution.format>
|
<distribution.format>zip</distribution.format>
|
||||||
<version.jackson>2.5.1</version.jackson>
|
<version.jackson>2.10.0</version.jackson>
|
||||||
<version.slf4j>1.7.10</version.slf4j>
|
<version.slf4j>1.7.25</version.slf4j>
|
||||||
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
|
<timestamp>${maven.build.timestamp}</timestamp>
|
||||||
|
<maven.build.timestamp.format>yyyy-MM-dd-HHmm</maven.build.timestamp.format>
|
||||||
|
<!--Turn off javadoc errors-->
|
||||||
|
<additionalparam>-Xdoclint:none</additionalparam>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -80,7 +86,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>4.12</version>
|
<version>4.13.1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--JSON-->
|
<!--JSON-->
|
||||||
@@ -115,219 +121,32 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.yamj</groupId>
|
<groupId>org.yamj</groupId>
|
||||||
<artifactId>api-common</artifactId>
|
<artifactId>api-common</artifactId>
|
||||||
<version>1.4</version>
|
<version>2.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Apache Utils -->
|
<!-- Apache Utils -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>3.7</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>2.4</version>
|
<version>2.6</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
|
||||||
<finalName>${project.artifactId}-${project.version}-${buildNumber}</finalName>
|
|
||||||
|
|
||||||
<plugins>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
|
||||||
<version>1.3</version>
|
|
||||||
<configuration>
|
|
||||||
<shortRevisionLength>10</shortRevisionLength>
|
|
||||||
<doCheck>false</doCheck>
|
|
||||||
<doUpdate>false</doUpdate>
|
|
||||||
<timestampFormat>{0,date,yyyy-MM-dd HH:mm:ss}</timestampFormat>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>validate</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>create</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.2</version>
|
|
||||||
<configuration>
|
|
||||||
<failOnError>true</failOnError>
|
|
||||||
<verbose>true</verbose>
|
|
||||||
<!-- excludes><exclude>**/*</exclude></excludes -->
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
|
||||||
<version>2.5</version>
|
|
||||||
<configuration>
|
|
||||||
<archive>
|
|
||||||
<manifestEntries>
|
|
||||||
<Specification-Title>${project.name}</Specification-Title>
|
|
||||||
<Specification-Version>${project.version}</Specification-Version>
|
|
||||||
<Implementation-Version>${buildNumber}</Implementation-Version>
|
|
||||||
<Implementation-Title>${timestamp}</Implementation-Title>
|
|
||||||
</manifestEntries>
|
|
||||||
</archive>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<version>2.18</version>
|
|
||||||
<configuration>
|
|
||||||
<!-- To skip tests by default -->
|
|
||||||
<skipTests>${skipTests}</skipTests>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-antrun-plugin</artifactId>
|
|
||||||
<version>1.7</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>create-version-txt</id>
|
|
||||||
<phase>generate-resources</phase>
|
|
||||||
<configuration>
|
|
||||||
<target>
|
|
||||||
<property name="version_file" value="${project.build.directory}/version.txt" />
|
|
||||||
<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="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">${buildnumber_line}</echo>
|
|
||||||
</target>
|
|
||||||
</configuration>
|
|
||||||
<goals>
|
|
||||||
<goal>run</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
|
||||||
<version>2.5.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>distro-assembly</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>single</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<descriptors>
|
|
||||||
<descriptor>src/main/resources/bin.xml</descriptor>
|
|
||||||
</descriptors>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>versions-maven-plugin</artifactId>
|
|
||||||
<version>2.1</version>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-site-plugin</artifactId>
|
|
||||||
<version>3.4</version>
|
|
||||||
<configuration>
|
|
||||||
<reportPlugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
|
||||||
<version>2.2</version>
|
|
||||||
<reports>
|
|
||||||
<report>index</report>
|
|
||||||
<report>scm</report>
|
|
||||||
<report>issue-tracking</report>
|
|
||||||
<report>help</report>
|
|
||||||
<report>dependency-convergence</report>
|
|
||||||
<report>summary</report>
|
|
||||||
<report>dependency-management</report>
|
|
||||||
<report>dependencies</report>
|
|
||||||
<report>license</report>
|
|
||||||
<report>modules</report>
|
|
||||||
</reports>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>2.9</version>
|
|
||||||
</plugin>
|
|
||||||
</reportPlugins>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
|
||||||
<version>2.6.1</version>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
|
||||||
<version>2.8.2</version>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
|
||||||
<version>1.5</version>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-install-plugin</artifactId>
|
|
||||||
<version>2.5.2</version>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
|
||||||
<version>2.7</version>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
</plugins>
|
|
||||||
|
|
||||||
<extensions>
|
|
||||||
<extension>
|
|
||||||
<groupId>org.apache.maven.scm</groupId>
|
|
||||||
<artifactId>maven-scm-provider-gitexe</artifactId>
|
|
||||||
<version>1.8.1</version>
|
|
||||||
</extension>
|
|
||||||
<extension>
|
|
||||||
<groupId>org.apache.maven.scm</groupId>
|
|
||||||
<artifactId>maven-scm-manager-plexus</artifactId>
|
|
||||||
<version>1.8.1</version>
|
|
||||||
</extension>
|
|
||||||
<extension>
|
|
||||||
<groupId>org.kathrynhuxtable.maven.wagon</groupId>
|
|
||||||
<artifactId>wagon-gitsite</artifactId>
|
|
||||||
<version>0.3.1</version>
|
|
||||||
</extension>
|
|
||||||
</extensions>
|
|
||||||
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>disable-java8-doclint</id>
|
||||||
|
<activation>
|
||||||
|
<jdk>[1.8,)</jdk>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<additionalparam>-Xdoclint:none</additionalparam>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>release-sign-artifacts</id>
|
<id>release-sign-artifacts</id>
|
||||||
<activation>
|
<activation>
|
||||||
@@ -355,4 +174,200 @@
|
|||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>${project.artifactId}-${project.version}-${timestamp}-${git.commit.id.abbrev}</finalName>
|
||||||
|
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources/</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<includes>
|
||||||
|
<include>version.txt</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.7.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<version>2.8.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-gpg-plugin</artifactId>
|
||||||
|
<version>1.6</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
|
<version>2.5.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
|
<version>3.7</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.21.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>pl.project13.maven</groupId>
|
||||||
|
<artifactId>git-commit-id-plugin</artifactId>
|
||||||
|
<version>2.2.4</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>pl.project13.maven</groupId>
|
||||||
|
<artifactId>git-commit-id-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>generate-resources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>revision</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
|
||||||
|
<dateFormat>yyyy-MM-dd HH:mm:ss z</dateFormat>
|
||||||
|
<abbrevLength>7</abbrevLength>
|
||||||
|
<injectAllReactorProjects>true</injectAllReactorProjects>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifestEntries>
|
||||||
|
<Specification-Title>${project.name}</Specification-Title>
|
||||||
|
<Specification-Version>${project.version}</Specification-Version>
|
||||||
|
<Implementation-Version>${buildNumber}</Implementation-Version>
|
||||||
|
<Implementation-Title>${timestamp}</Implementation-Title>
|
||||||
|
</manifestEntries>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<!-- To skip tests by default -->
|
||||||
|
<skipTests>${skipTests}</skipTests>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>distro-assembly</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<descriptors>
|
||||||
|
<descriptor>src/main/resources/bin.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<failOnError>true</failOnError>
|
||||||
|
<verbose>true</verbose>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<reportPlugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
|
<reports>
|
||||||
|
<report>index</report>
|
||||||
|
<report>scm</report>
|
||||||
|
<report>issue-tracking</report>
|
||||||
|
<report>help</report>
|
||||||
|
<report>dependency-convergence</report>
|
||||||
|
<report>summary</report>
|
||||||
|
<report>dependency-management</report>
|
||||||
|
<report>dependencies</report>
|
||||||
|
<report>license</report>
|
||||||
|
<report>modules</report>
|
||||||
|
</reports>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</reportPlugins>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
</plugins>
|
||||||
|
|
||||||
|
<extensions>
|
||||||
|
<extension>
|
||||||
|
<groupId>org.apache.maven.scm</groupId>
|
||||||
|
<artifactId>maven-scm-provider-gitexe</artifactId>
|
||||||
|
<version>1.9.5</version>
|
||||||
|
</extension>
|
||||||
|
<extension>
|
||||||
|
<groupId>org.apache.maven.scm</groupId>
|
||||||
|
<artifactId>maven-scm-manager-plexus</artifactId>
|
||||||
|
<version>1.9.5</version>
|
||||||
|
</extension>
|
||||||
|
<extension>
|
||||||
|
<groupId>org.kathrynhuxtable.maven.wagon</groupId>
|
||||||
|
<artifactId>wagon-gitsite</artifactId>
|
||||||
|
<version>0.3.1</version>
|
||||||
|
</extension>
|
||||||
|
</extensions>
|
||||||
|
|
||||||
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -28,21 +28,21 @@ import com.omertron.themoviedbapi.interfaces.AppendToResponseMethod;
|
|||||||
*/
|
*/
|
||||||
public class AppendToResponseBuilder {
|
public class AppendToResponseBuilder {
|
||||||
|
|
||||||
private StringBuilder response;
|
private final StringBuilder response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct the builder with the first method
|
* Construct the builder with the first method
|
||||||
*
|
*
|
||||||
* @param method
|
* @param method method
|
||||||
*/
|
*/
|
||||||
public AppendToResponseBuilder(AppendToResponseMethod method) {
|
public AppendToResponseBuilder(AppendToResponseMethod method) {
|
||||||
response.append(method.getPropertyString());
|
response = new StringBuilder(method.getPropertyString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the string
|
* Generate the string
|
||||||
*
|
*
|
||||||
* @return
|
* @return ATR string
|
||||||
*/
|
*/
|
||||||
public String build() {
|
public String build() {
|
||||||
return response.toString();
|
return response.toString();
|
||||||
@@ -51,8 +51,8 @@ public class AppendToResponseBuilder {
|
|||||||
/**
|
/**
|
||||||
* Add a method to the list
|
* Add a method to the list
|
||||||
*
|
*
|
||||||
* @param method
|
* @param method method
|
||||||
* @return
|
* @return builder
|
||||||
*/
|
*/
|
||||||
public AppendToResponseBuilder add(AppendToResponseMethod method) {
|
public AppendToResponseBuilder add(AppendToResponseMethod method) {
|
||||||
response.append(",").append(method.getPropertyString());
|
response.append(",").append(method.getPropertyString());
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -39,7 +39,7 @@ public class Compare {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare the MovieDB object with a title & year
|
* Compare the MovieDB object with a title and year
|
||||||
*
|
*
|
||||||
* @param moviedb The moviedb object to compare too
|
* @param moviedb The moviedb object to compare too
|
||||||
* @param title The title of the movie to compare
|
* @param title The title of the movie to compare
|
||||||
@@ -51,7 +51,7 @@ public class Compare {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare the MovieDB object with a title & year
|
* Compare the MovieDB object with a title and year
|
||||||
*
|
*
|
||||||
* @param moviedb The moviedb object to compare too
|
* @param moviedb The moviedb object to compare too
|
||||||
* @param title The title of the movie to compare
|
* @param title The title of the movie to compare
|
||||||
@@ -107,13 +107,13 @@ public class Compare {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare the MovieDB object with a title & year, case sensitive
|
* Compare the MovieDB object with a title and year, case sensitive
|
||||||
*
|
*
|
||||||
* @param moviedb
|
* @param moviedb movieinfo
|
||||||
* @param title
|
* @param title title
|
||||||
* @param year
|
* @param year year
|
||||||
* @param maxDistance
|
* @param maxDistance maximum distance
|
||||||
* @return
|
* @return true if matched
|
||||||
*/
|
*/
|
||||||
public static boolean movies(final MovieInfo moviedb, final String title, final String year, int maxDistance) {
|
public static boolean movies(final MovieInfo moviedb, final String title, final String year, int maxDistance) {
|
||||||
return Compare.movies(moviedb, title, year, maxDistance, true);
|
return Compare.movies(moviedb, title, year, maxDistance, true);
|
||||||
@@ -122,9 +122,9 @@ public class Compare {
|
|||||||
/**
|
/**
|
||||||
* Compare the Levenshtein Distance between the two strings
|
* Compare the Levenshtein Distance between the two strings
|
||||||
*
|
*
|
||||||
* @param title1
|
* @param title1 title
|
||||||
* @param title2
|
* @param title2 title
|
||||||
* @param distance
|
* @param distance max distance
|
||||||
*/
|
*/
|
||||||
private static boolean compareDistance(final String title1, final String title2, int distance) {
|
private static boolean compareDistance(final String title1, final String title2, int distance) {
|
||||||
return StringUtils.getLevenshteinDistance(title1, title2) <= distance;
|
return StringUtils.getLevenshteinDistance(title1, title2) <= distance;
|
||||||
@@ -133,7 +133,7 @@ public class Compare {
|
|||||||
/**
|
/**
|
||||||
* Check the year is not blank or UNKNOWN
|
* Check the year is not blank or UNKNOWN
|
||||||
*
|
*
|
||||||
* @param year
|
* @param year year
|
||||||
*/
|
*/
|
||||||
private static boolean isValidYear(final String year) {
|
private static boolean isValidYear(final String year) {
|
||||||
return StringUtils.isNotBlank(year) && !"UNKNOWN".equals(year);
|
return StringUtils.isNotBlank(year) && !"UNKNOWN".equals(year);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -46,8 +46,8 @@ public enum ArtworkType {
|
|||||||
/**
|
/**
|
||||||
* Convert a string into an Enum type
|
* Convert a string into an Enum type
|
||||||
*
|
*
|
||||||
* @param artworkType
|
* @param artworkType String to convert to enum
|
||||||
* @return
|
* @return enum version of param
|
||||||
* @throws IllegalArgumentException If type is not recognised
|
* @throws IllegalArgumentException If type is not recognised
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2016 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.enumeration;
|
||||||
|
|
||||||
|
public enum Gender {
|
||||||
|
MALE(2),
|
||||||
|
FEMALE(1),
|
||||||
|
UNKNOWN(0);
|
||||||
|
|
||||||
|
private final int type;
|
||||||
|
|
||||||
|
private Gender(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the gender from an integer type
|
||||||
|
*
|
||||||
|
* @param type Integer to convert to enum
|
||||||
|
* @return enum version of param
|
||||||
|
*/
|
||||||
|
public static Gender fromInteger(int type) {
|
||||||
|
for (Gender gender : Gender.values()) {
|
||||||
|
if (gender.type == type) {
|
||||||
|
return gender;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -36,6 +36,10 @@ public enum MediaType {
|
|||||||
* TV Show media type
|
* TV Show media type
|
||||||
*/
|
*/
|
||||||
TV,
|
TV,
|
||||||
|
/**
|
||||||
|
* TV Season media type
|
||||||
|
*/
|
||||||
|
SEASON,
|
||||||
/**
|
/**
|
||||||
* TV Episode media type
|
* TV Episode media type
|
||||||
*/
|
*/
|
||||||
@@ -44,8 +48,8 @@ public enum MediaType {
|
|||||||
/**
|
/**
|
||||||
* Convert a string into an Enum type
|
* Convert a string into an Enum type
|
||||||
*
|
*
|
||||||
* @param mediaType
|
* @param mediaType String to convert to enum
|
||||||
* @return
|
* @return enum version of param
|
||||||
* @throws IllegalArgumentException If type is not recognised
|
* @throws IllegalArgumentException If type is not recognised
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -35,6 +35,7 @@ public enum MovieMethod implements AppendToResponseMethod {
|
|||||||
IMAGES,
|
IMAGES,
|
||||||
KEYWORDS,
|
KEYWORDS,
|
||||||
LISTS,
|
LISTS,
|
||||||
|
RECOMMENDATIONS,
|
||||||
RELEASES,
|
RELEASES,
|
||||||
REVIEWS,
|
REVIEWS,
|
||||||
SIMILAR,
|
SIMILAR,
|
||||||
@@ -44,7 +45,7 @@ public enum MovieMethod implements AppendToResponseMethod {
|
|||||||
/**
|
/**
|
||||||
* Get the string to use in the URL
|
* Get the string to use in the URL
|
||||||
*
|
*
|
||||||
* @return
|
* @return the string representation of the enum
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getPropertyString() {
|
public String getPropertyString() {
|
||||||
@@ -54,8 +55,8 @@ public enum MovieMethod implements AppendToResponseMethod {
|
|||||||
/**
|
/**
|
||||||
* Convert a string into an Enum type
|
* Convert a string into an Enum type
|
||||||
*
|
*
|
||||||
* @param method
|
* @param method String to convert to enum
|
||||||
* @return
|
* @return enum version of param
|
||||||
* @throws IllegalArgumentException If type is not recognised
|
* @throws IllegalArgumentException If type is not recognised
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -40,7 +40,7 @@ public enum PeopleMethod implements AppendToResponseMethod {
|
|||||||
/**
|
/**
|
||||||
* Get the string to use in the URL
|
* Get the string to use in the URL
|
||||||
*
|
*
|
||||||
* @return
|
* @return the string representation of the enum
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getPropertyString() {
|
public String getPropertyString() {
|
||||||
@@ -50,8 +50,8 @@ public enum PeopleMethod implements AppendToResponseMethod {
|
|||||||
/**
|
/**
|
||||||
* Convert a string into an Enum type
|
* Convert a string into an Enum type
|
||||||
*
|
*
|
||||||
* @param method
|
* @param method String to convert to enum
|
||||||
* @return
|
* @return enum version of param
|
||||||
* @throws IllegalArgumentException If type is not recognised
|
* @throws IllegalArgumentException If type is not recognised
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2016 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.enumeration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Release Type for the video
|
||||||
|
*
|
||||||
|
* @author stuar
|
||||||
|
*/
|
||||||
|
public enum ReleaseType {
|
||||||
|
PREMIERE(1),
|
||||||
|
THEATRICAL_LIMITED(2),
|
||||||
|
THEATRICAL(3),
|
||||||
|
DIGITAL(4),
|
||||||
|
PHYSICAL(5),
|
||||||
|
TV(6),
|
||||||
|
UNKNOWN(0);
|
||||||
|
|
||||||
|
private final int type;
|
||||||
|
|
||||||
|
private ReleaseType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Release Type from an integer type
|
||||||
|
*
|
||||||
|
* @param type Integer to convert to enum
|
||||||
|
* @return enum version of param
|
||||||
|
*/
|
||||||
|
public static ReleaseType fromInteger(int type) {
|
||||||
|
for (ReleaseType rt : ReleaseType.values()) {
|
||||||
|
if (rt.type == type) {
|
||||||
|
return rt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -37,7 +37,7 @@ public enum TVEpisodeMethod implements AppendToResponseMethod {
|
|||||||
/**
|
/**
|
||||||
* Get the string to use in the URL
|
* Get the string to use in the URL
|
||||||
*
|
*
|
||||||
* @return
|
* @return the string representation of the enum
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getPropertyString() {
|
public String getPropertyString() {
|
||||||
@@ -47,8 +47,8 @@ public enum TVEpisodeMethod implements AppendToResponseMethod {
|
|||||||
/**
|
/**
|
||||||
* Convert a string into an Enum type
|
* Convert a string into an Enum type
|
||||||
*
|
*
|
||||||
* @param method
|
* @param method String to convert to enum
|
||||||
* @return
|
* @return enum version of param
|
||||||
* @throws IllegalArgumentException If type is not recognised
|
* @throws IllegalArgumentException If type is not recognised
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -32,6 +32,7 @@ import com.omertron.themoviedbapi.model.list.UserList;
|
|||||||
import com.omertron.themoviedbapi.model.media.AlternativeTitle;
|
import com.omertron.themoviedbapi.model.media.AlternativeTitle;
|
||||||
import com.omertron.themoviedbapi.model.movie.MovieBasic;
|
import com.omertron.themoviedbapi.model.movie.MovieBasic;
|
||||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||||
|
import com.omertron.themoviedbapi.model.movie.ReleaseDates;
|
||||||
import com.omertron.themoviedbapi.model.person.ContentRating;
|
import com.omertron.themoviedbapi.model.person.ContentRating;
|
||||||
import com.omertron.themoviedbapi.model.person.PersonInfo;
|
import com.omertron.themoviedbapi.model.person.PersonInfo;
|
||||||
import com.omertron.themoviedbapi.model.person.PersonFind;
|
import com.omertron.themoviedbapi.model.person.PersonFind;
|
||||||
@@ -48,6 +49,7 @@ import com.omertron.themoviedbapi.tools.TmdbParameters;
|
|||||||
import com.omertron.themoviedbapi.results.WrapperChanges;
|
import com.omertron.themoviedbapi.results.WrapperChanges;
|
||||||
import com.omertron.themoviedbapi.results.WrapperGenericList;
|
import com.omertron.themoviedbapi.results.WrapperGenericList;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -67,7 +69,7 @@ public class AbstractMethod {
|
|||||||
protected final HttpTools httpTools;
|
protected final HttpTools httpTools;
|
||||||
// Jackson JSON configuration
|
// Jackson JSON configuration
|
||||||
protected static final ObjectMapper MAPPER = new ObjectMapper();
|
protected static final ObjectMapper MAPPER = new ObjectMapper();
|
||||||
private static final Map<Class, TypeReference> TYPE_REFS = new HashMap<Class, TypeReference>();
|
private static final Map<Class<? extends Serializable>, TypeReference<? extends WrapperGenericList<? extends Serializable>>> TYPE_REFS = new HashMap<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
TYPE_REFS.put(MovieBasic.class, new TypeReference<WrapperGenericList<MovieBasic>>() {
|
TYPE_REFS.put(MovieBasic.class, new TypeReference<WrapperGenericList<MovieBasic>>() {
|
||||||
@@ -100,6 +102,8 @@ public class AbstractMethod {
|
|||||||
});
|
});
|
||||||
TYPE_REFS.put(AlternativeTitle.class, new TypeReference<WrapperGenericList<AlternativeTitle>>() {
|
TYPE_REFS.put(AlternativeTitle.class, new TypeReference<WrapperGenericList<AlternativeTitle>>() {
|
||||||
});
|
});
|
||||||
|
TYPE_REFS.put(ReleaseDates.class, new TypeReference<WrapperGenericList<ReleaseDates>>() {
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,9 +125,9 @@ public class AbstractMethod {
|
|||||||
* @return
|
* @return
|
||||||
* @throws MovieDbException
|
* @throws MovieDbException
|
||||||
*/
|
*/
|
||||||
protected static TypeReference getTypeReference(Class aClass) throws MovieDbException {
|
protected static <T> TypeReference<? extends WrapperGenericList<T>> getTypeReference(Class<T> aClass) throws MovieDbException {
|
||||||
if (TYPE_REFS.containsKey(aClass)) {
|
if (TYPE_REFS.containsKey(aClass)) {
|
||||||
return TYPE_REFS.get(aClass);
|
return (TypeReference<? extends WrapperGenericList<T>>) TYPE_REFS.get(aClass);
|
||||||
} else {
|
} else {
|
||||||
throw new MovieDbException(ApiExceptionType.UNKNOWN_CAUSE, "Class type reference for '" + aClass.getSimpleName() + "' not found!");
|
throw new MovieDbException(ApiExceptionType.UNKNOWN_CAUSE, "Class type reference for '" + aClass.getSimpleName() + "' not found!");
|
||||||
}
|
}
|
||||||
@@ -139,7 +143,7 @@ public class AbstractMethod {
|
|||||||
* @return
|
* @return
|
||||||
* @throws MovieDbException
|
* @throws MovieDbException
|
||||||
*/
|
*/
|
||||||
protected <T> List<T> processWrapperList(TypeReference typeRef, URL url, String errorMessageSuffix) throws MovieDbException {
|
protected <T> List<T> processWrapperList(TypeReference<? extends WrapperGenericList<T>> typeRef, URL url, String errorMessageSuffix) throws MovieDbException {
|
||||||
WrapperGenericList<T> val = processWrapper(typeRef, url, errorMessageSuffix);
|
WrapperGenericList<T> val = processWrapper(typeRef, url, errorMessageSuffix);
|
||||||
return val.getResults();
|
return val.getResults();
|
||||||
}
|
}
|
||||||
@@ -154,7 +158,7 @@ public class AbstractMethod {
|
|||||||
* @return
|
* @return
|
||||||
* @throws MovieDbException
|
* @throws MovieDbException
|
||||||
*/
|
*/
|
||||||
protected <T> WrapperGenericList<T> processWrapper(TypeReference typeRef, URL url, String errorMessageSuffix) throws MovieDbException {
|
protected <T> WrapperGenericList<T> processWrapper(TypeReference<? extends WrapperGenericList<T>> typeRef, URL url, String errorMessageSuffix) throws MovieDbException {
|
||||||
String webpage = httpTools.getRequest(url);
|
String webpage = httpTools.getRequest(url);
|
||||||
try {
|
try {
|
||||||
// Due to type erasure, this doesn't work
|
// Due to type erasure, this doesn't work
|
||||||
@@ -186,7 +190,7 @@ public class AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperChanges wrapper = MAPPER.readValue(webpage, WrapperChanges.class);
|
WrapperChanges wrapper = MAPPER.readValue(webpage, WrapperChanges.class);
|
||||||
ResultList<ChangeKeyItem> results = new ResultList<ChangeKeyItem>(wrapper.getChangedItems());
|
ResultList<ChangeKeyItem> results = new ResultList<>(wrapper.getChangedItems());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -50,13 +50,16 @@ public class TmdbAuthentication extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to generate a valid request token for user based authentication.
|
* This method is used to generate a valid request token for user based
|
||||||
|
* authentication.
|
||||||
*
|
*
|
||||||
* A request token is required in order to request a session id.
|
* A request token is required in order to request a session id.
|
||||||
*
|
*
|
||||||
* You can generate any number of request tokens but they will expire after 60 minutes.
|
* You can generate any number of request tokens but they will expire after
|
||||||
|
* 60 minutes.
|
||||||
*
|
*
|
||||||
* As soon as a valid session id has been created the token will be destroyed.
|
* As soon as a valid session id has been created the token will be
|
||||||
|
* destroyed.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* @throws MovieDbException
|
* @throws MovieDbException
|
||||||
@@ -75,7 +78,8 @@ public class TmdbAuthentication extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to generate a session id for user based authentication.
|
* This method is used to generate a session id for user based
|
||||||
|
* authentication.
|
||||||
*
|
*
|
||||||
* A session id is required in order to use any of the write methods.
|
* A session id is required in order to use any of the write methods.
|
||||||
*
|
*
|
||||||
@@ -102,7 +106,8 @@ public class TmdbAuthentication extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to generate a session id for user based authentication. User must provide their username and password
|
* This method is used to generate a session id for user based
|
||||||
|
* authentication. User must provide their username and password
|
||||||
*
|
*
|
||||||
* A session id is required in order to use any of the write methods.
|
* A session id is required in order to use any of the write methods.
|
||||||
*
|
*
|
||||||
@@ -136,14 +141,18 @@ public class TmdbAuthentication extends AbstractMethod {
|
|||||||
/**
|
/**
|
||||||
* This method is used to generate a guest session id.
|
* This method is used to generate a guest session id.
|
||||||
*
|
*
|
||||||
* A guest session can be used to rate movies without having a registered TMDb user account.
|
* A guest session can be used to rate movies without having a registered
|
||||||
|
* TMDb user account.
|
||||||
*
|
*
|
||||||
* You should only generate a single guest session per user (or device) as you will be able to attach the ratings to a TMDb user
|
* You should only generate a single guest session per user (or device) as
|
||||||
* account in the future.
|
* you will be able to attach the ratings to a TMDb user account in the
|
||||||
|
* future.
|
||||||
*
|
*
|
||||||
* There are also IP limits in place so you should always make sure it's the end user doing the guest session actions.
|
* There are also IP limits in place so you should always make sure it's the
|
||||||
|
* end user doing the guest session actions.
|
||||||
*
|
*
|
||||||
* If a guest session is not used for the first time within 24 hours, it will be automatically discarded.
|
* If a guest session is not used for the first time within 24 hours, it
|
||||||
|
* will be automatically discarded.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* @throws MovieDbException
|
* @throws MovieDbException
|
||||||
@@ -157,4 +166,5 @@ public class TmdbAuthentication extends AbstractMethod {
|
|||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get Guest Session Token", url, ex);
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get Guest Session Token", url, ex);
|
||||||
}
|
}
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -65,7 +65,7 @@ public class TmdbCertifications extends AbstractMethod {
|
|||||||
JsonNode node = MAPPER.readTree(webpage);
|
JsonNode node = MAPPER.readTree(webpage);
|
||||||
Map<String, List<Certification>> results = MAPPER.readValue(node.elements().next().traverse(), new TypeReference<Map<String, List<Certification>>>() {
|
Map<String, List<Certification>> results = MAPPER.readValue(node.elements().next().traverse(), new TypeReference<Map<String, List<Certification>>>() {
|
||||||
});
|
});
|
||||||
return new ResultsMap<String, List<Certification>>(results);
|
return new ResultsMap<>(results);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get movie certifications", url, ex);
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get movie certifications", url, ex);
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@ public class TmdbCertifications extends AbstractMethod {
|
|||||||
JsonNode node = MAPPER.readTree(webpage);
|
JsonNode node = MAPPER.readTree(webpage);
|
||||||
Map<String, List<Certification>> results = MAPPER.readValue(node.elements().next().traverse(), new TypeReference<Map<String, List<Certification>>>() {
|
Map<String, List<Certification>> results = MAPPER.readValue(node.elements().next().traverse(), new TypeReference<Map<String, List<Certification>>>() {
|
||||||
});
|
});
|
||||||
return new ResultsMap<String, List<Certification>>(results);
|
return new ResultsMap<>(results);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get TV certifications", url, ex);
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get TV certifications", url, ex);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -97,7 +97,7 @@ public class TmdbCollections extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
||||||
ResultList<Artwork> results = new ResultList<Artwork>(wrapper.getAll(ArtworkType.POSTER, ArtworkType.BACKDROP));
|
ResultList<Artwork> results = new ResultList<>(wrapper.getAll(ArtworkType.POSTER, ArtworkType.BACKDROP));
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -95,7 +95,7 @@ public class TmdbConfiguration extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperJobList wrapper = MAPPER.readValue(webpage, WrapperJobList.class);
|
WrapperJobList wrapper = MAPPER.readValue(webpage, WrapperJobList.class);
|
||||||
ResultList<JobDepartment> results = new ResultList<JobDepartment>(wrapper.getJobs());
|
ResultList<JobDepartment> results = new ResultList<>(wrapper.getJobs());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -121,7 +121,7 @@ public class TmdbConfiguration extends AbstractMethod {
|
|||||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get timezone list", url, ex);
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get timezone list", url, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResultsMap<String, List<String>> timezones = new ResultsMap<String, List<String>>();
|
ResultsMap<String, List<String>> timezones = new ResultsMap<>();
|
||||||
|
|
||||||
for (Map<String, List<String>> tzMap : tzList) {
|
for (Map<String, List<String>> tzMap : tzList) {
|
||||||
for (Map.Entry<String, List<String>> x : tzMap.entrySet()) {
|
for (Map.Entry<String, List<String>> x : tzMap.entrySet()) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -28,7 +28,6 @@ import com.omertron.themoviedbapi.tools.Param;
|
|||||||
import com.omertron.themoviedbapi.tools.TmdbParameters;
|
import com.omertron.themoviedbapi.tools.TmdbParameters;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.yamj.api.common.exception.ApiExceptionType;
|
import org.yamj.api.common.exception.ApiExceptionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -78,7 +77,6 @@ public class TmdbCredits extends AbstractMethod {
|
|||||||
try {
|
try {
|
||||||
return MAPPER.readValue(webpage, CreditInfo.class);
|
return MAPPER.readValue(webpage, CreditInfo.class);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
LoggerFactory.getLogger("test").info("{}",ex);
|
|
||||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get credit info", url, ex);
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get credit info", url, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -42,7 +42,6 @@ import com.omertron.themoviedbapi.results.WrapperImages;
|
|||||||
import com.omertron.themoviedbapi.results.WrapperVideos;
|
import com.omertron.themoviedbapi.results.WrapperVideos;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.yamj.api.common.exception.ApiExceptionType;
|
import org.yamj.api.common.exception.ApiExceptionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,7 +64,8 @@ public class TmdbEpisodes extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the primary information about a TV episode by combination of a season and episode number.
|
* Get the primary information about a TV episode by combination of a season
|
||||||
|
* and episode number.
|
||||||
*
|
*
|
||||||
* @param tvID
|
* @param tvID
|
||||||
* @param seasonNumber
|
* @param seasonNumber
|
||||||
@@ -89,7 +89,6 @@ public class TmdbEpisodes extends AbstractMethod {
|
|||||||
try {
|
try {
|
||||||
return MAPPER.readValue(webpage, TVEpisodeInfo.class);
|
return MAPPER.readValue(webpage, TVEpisodeInfo.class);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
LoggerFactory.getLogger("test").warn("{}", ex);
|
|
||||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get TV Episode Info", url, ex);
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get TV Episode Info", url, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,7 +107,8 @@ public class TmdbEpisodes extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method lets users get the status of whether or not the TV episode has been rated.
|
* This method lets users get the status of whether or not the TV episode
|
||||||
|
* has been rated.
|
||||||
*
|
*
|
||||||
* A valid session id is required.
|
* A valid session id is required.
|
||||||
*
|
*
|
||||||
@@ -161,7 +161,8 @@ public class TmdbEpisodes extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the external ids for a TV episode by comabination of a season and episode number.
|
* Get the external ids for a TV episode by comabination of a season and
|
||||||
|
* episode number.
|
||||||
*
|
*
|
||||||
* @param tvID
|
* @param tvID
|
||||||
* @param seasonNumber
|
* @param seasonNumber
|
||||||
@@ -188,7 +189,8 @@ public class TmdbEpisodes extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the images (episode stills) for a TV episode by combination of a season and episode number.
|
* Get the images (episode stills) for a TV episode by combination of a
|
||||||
|
* season and episode number.
|
||||||
*
|
*
|
||||||
* @param tvID
|
* @param tvID
|
||||||
* @param seasonNumber
|
* @param seasonNumber
|
||||||
@@ -207,7 +209,7 @@ public class TmdbEpisodes extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
||||||
ResultList<Artwork> results = new ResultList<Artwork>(wrapper.getAll());
|
ResultList<Artwork> results = new ResultList<>(wrapper.getAll());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -216,7 +218,8 @@ public class TmdbEpisodes extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method lets users rate a TV episode. A valid session id or guest session id is required.
|
* This method lets users rate a TV episode. A valid session id or guest
|
||||||
|
* session id is required.
|
||||||
*
|
*
|
||||||
* @param tvID
|
* @param tvID
|
||||||
* @param seasonNumber
|
* @param seasonNumber
|
||||||
@@ -253,7 +256,8 @@ public class TmdbEpisodes extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the videos that have been added to a TV episode (teasers, clips, etc...)
|
* Get the videos that have been added to a TV episode (teasers, clips,
|
||||||
|
* etc...)
|
||||||
*
|
*
|
||||||
* @param tvID
|
* @param tvID
|
||||||
* @param seasonNumber
|
* @param seasonNumber
|
||||||
@@ -274,7 +278,7 @@ public class TmdbEpisodes extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
|
WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
|
||||||
ResultList<Video> results = new ResultList<Video>(wrapper.getVideos());
|
ResultList<Video> results = new ResultList<>(wrapper.getVideos());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -91,7 +91,7 @@ public class TmdbGenres extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperGenres wrapper = MAPPER.readValue(webpage, WrapperGenres.class);
|
WrapperGenres wrapper = MAPPER.readValue(webpage, WrapperGenres.class);
|
||||||
ResultList<Genre> results = new ResultList<Genre>(wrapper.getGenres());
|
ResultList<Genre> results = new ResultList<>(wrapper.getGenres());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -32,6 +32,7 @@ import com.omertron.themoviedbapi.model.media.MediaState;
|
|||||||
import com.omertron.themoviedbapi.model.media.Translation;
|
import com.omertron.themoviedbapi.model.media.Translation;
|
||||||
import com.omertron.themoviedbapi.model.media.Video;
|
import com.omertron.themoviedbapi.model.media.Video;
|
||||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||||
|
import com.omertron.themoviedbapi.model.movie.ReleaseDates;
|
||||||
import com.omertron.themoviedbapi.model.movie.ReleaseInfo;
|
import com.omertron.themoviedbapi.model.movie.ReleaseInfo;
|
||||||
import com.omertron.themoviedbapi.model.review.Review;
|
import com.omertron.themoviedbapi.model.review.Review;
|
||||||
import com.omertron.themoviedbapi.results.ResultList;
|
import com.omertron.themoviedbapi.results.ResultList;
|
||||||
@@ -78,8 +79,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
*
|
*
|
||||||
* It will return the single highest rated poster and backdrop.
|
* It will return the single highest rated poster and backdrop.
|
||||||
*
|
*
|
||||||
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies
|
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies found.
|
||||||
* found.
|
|
||||||
*
|
*
|
||||||
* @param movieId
|
* @param movieId
|
||||||
* @param language
|
* @param language
|
||||||
@@ -111,8 +111,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
*
|
*
|
||||||
* It will return the single highest rated poster and backdrop.
|
* It will return the single highest rated poster and backdrop.
|
||||||
*
|
*
|
||||||
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies
|
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies found.
|
||||||
* found.
|
|
||||||
*
|
*
|
||||||
* @param imdbId
|
* @param imdbId
|
||||||
* @param language
|
* @param language
|
||||||
@@ -141,8 +140,8 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method lets a user get the status of whether or not the movie has
|
* This method lets a user get the status of whether or not the movie has been rated or added to their favourite or movie watch
|
||||||
* been rated or added to their favourite or movie watch list.
|
* list.
|
||||||
*
|
*
|
||||||
* A valid session id is required.
|
* A valid session id is required.
|
||||||
*
|
*
|
||||||
@@ -167,8 +166,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to retrieve all of the alternative titles we have for
|
* This method is used to retrieve all of the alternative titles we have for a particular movie.
|
||||||
* a particular movie.
|
|
||||||
*
|
*
|
||||||
* @param movieId
|
* @param movieId
|
||||||
* @param country
|
* @param country
|
||||||
@@ -184,7 +182,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
String webpage = httpTools.getRequest(url);
|
String webpage = httpTools.getRequest(url);
|
||||||
try {
|
try {
|
||||||
WrapperAlternativeTitles wrapper = MAPPER.readValue(webpage, WrapperAlternativeTitles.class);
|
WrapperAlternativeTitles wrapper = MAPPER.readValue(webpage, WrapperAlternativeTitles.class);
|
||||||
ResultList<AlternativeTitle> results = new ResultList<AlternativeTitle>(wrapper.getTitles());
|
ResultList<AlternativeTitle> results = new ResultList<>(wrapper.getTitles());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -213,8 +211,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method should be used when you’re wanting to retrieve all of the
|
* This method should be used when you’re wanting to retrieve all of the images for a particular movie.
|
||||||
* images for a particular movie.
|
|
||||||
*
|
*
|
||||||
* @param movieId
|
* @param movieId
|
||||||
* @param language
|
* @param language
|
||||||
@@ -231,7 +228,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
||||||
ResultList<Artwork> results = new ResultList<Artwork>(wrapper.getAll());
|
ResultList<Artwork> results = new ResultList<>(wrapper.getAll());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -240,8 +237,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to retrieve all of the keywords that have been added
|
* This method is used to retrieve all of the keywords that have been added to a particular movie.
|
||||||
* to a particular movie.
|
|
||||||
*
|
*
|
||||||
* Currently, only English keywords exist.
|
* Currently, only English keywords exist.
|
||||||
*
|
*
|
||||||
@@ -258,7 +254,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperMovieKeywords wrapper = MAPPER.readValue(webpage, WrapperMovieKeywords.class);
|
WrapperMovieKeywords wrapper = MAPPER.readValue(webpage, WrapperMovieKeywords.class);
|
||||||
ResultList<Keyword> results = new ResultList<Keyword>(wrapper.getKeywords());
|
ResultList<Keyword> results = new ResultList<>(wrapper.getKeywords());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -267,8 +263,25 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to retrieve all of the release and certification data
|
* The recommendations method will let you retrieve the movie recommendations for a particular movie.
|
||||||
* we have for a specific movie.
|
*
|
||||||
|
* @param movieId
|
||||||
|
* @param language
|
||||||
|
* @return
|
||||||
|
* @throws MovieDbException
|
||||||
|
*/
|
||||||
|
public ResultList<MovieInfo> getRecommendations(int movieId, String language) throws MovieDbException {
|
||||||
|
TmdbParameters parameters = new TmdbParameters();
|
||||||
|
parameters.add(Param.ID, movieId);
|
||||||
|
parameters.add(Param.LANGUAGE, language);
|
||||||
|
|
||||||
|
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.RECOMMENDATIONS).buildUrl(parameters);
|
||||||
|
WrapperGenericList<MovieInfo> wrapper = processWrapper(getTypeReference(MovieInfo.class), url, "recommendations");
|
||||||
|
return wrapper.getResultsList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is used to retrieve all of the release and certification data we have for a specific movie.
|
||||||
*
|
*
|
||||||
* @param movieId
|
* @param movieId
|
||||||
* @param language
|
* @param language
|
||||||
@@ -285,7 +298,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperReleaseInfo wrapper = MAPPER.readValue(webpage, WrapperReleaseInfo.class);
|
WrapperReleaseInfo wrapper = MAPPER.readValue(webpage, WrapperReleaseInfo.class);
|
||||||
ResultList<ReleaseInfo> results = new ResultList<ReleaseInfo>(wrapper.getCountries());
|
ResultList<ReleaseInfo> results = new ResultList<>(wrapper.getCountries());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -294,8 +307,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to retrieve all of the trailers for a particular
|
* This method is used to retrieve all of the trailers for a particular movie.
|
||||||
* movie.
|
|
||||||
*
|
*
|
||||||
* Supported sites are YouTube and QuickTime.
|
* Supported sites are YouTube and QuickTime.
|
||||||
*
|
*
|
||||||
@@ -314,7 +326,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
|
WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
|
||||||
ResultList<Video> results = new ResultList<Video>(wrapper.getVideos());
|
ResultList<Video> results = new ResultList<>(wrapper.getVideos());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -323,8 +335,25 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to retrieve a list of the available translations for
|
* Get the release dates, certifications and related information by country for a specific movie id.
|
||||||
* a specific movie.
|
*
|
||||||
|
* The results are keyed by country code and contain a type value.
|
||||||
|
*
|
||||||
|
* @param movieId
|
||||||
|
* @return
|
||||||
|
* @throws MovieDbException
|
||||||
|
*/
|
||||||
|
public ResultList<ReleaseDates> getReleaseDates(int movieId) throws MovieDbException {
|
||||||
|
TmdbParameters parameters = new TmdbParameters();
|
||||||
|
parameters.add(Param.ID, movieId);
|
||||||
|
|
||||||
|
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.RELEASE_DATES).buildUrl(parameters);
|
||||||
|
WrapperGenericList<ReleaseDates> wrapper = processWrapper(getTypeReference(ReleaseDates.class), url, "release dates");
|
||||||
|
return wrapper.getResultsList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is used to retrieve a list of the available translations for a specific movie.
|
||||||
*
|
*
|
||||||
* @param movieId
|
* @param movieId
|
||||||
* @return
|
* @return
|
||||||
@@ -339,7 +368,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperTranslations wrapper = MAPPER.readValue(webpage, WrapperTranslations.class);
|
WrapperTranslations wrapper = MAPPER.readValue(webpage, WrapperTranslations.class);
|
||||||
ResultList<Translation> results = new ResultList<Translation>(wrapper.getTranslations());
|
ResultList<Translation> results = new ResultList<>(wrapper.getTranslations());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -348,11 +377,9 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The similar movies method will let you retrieve the similar movies for a
|
* The similar movies method will let you retrieve the similar movies for a particular movie.
|
||||||
* particular movie.
|
|
||||||
*
|
*
|
||||||
* This data is created dynamically but with the help of users votes on
|
* This data is created dynamically but with the help of users votes on TMDb.
|
||||||
* TMDb.
|
|
||||||
*
|
*
|
||||||
* The data is much better with movies that have more keywords
|
* The data is much better with movies that have more keywords
|
||||||
*
|
*
|
||||||
@@ -420,8 +447,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
*
|
*
|
||||||
* By default, only the last 24 hours of changes are returned.
|
* By default, only the last 24 hours of changes are returned.
|
||||||
*
|
*
|
||||||
* The maximum number of days that can be returned in a single request is
|
* The maximum number of days that can be returned in a single request is 14.
|
||||||
* 14.
|
|
||||||
*
|
*
|
||||||
* The language is present on fields that are translatable.
|
* The language is present on fields that are translatable.
|
||||||
*
|
*
|
||||||
@@ -513,8 +539,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
/**
|
/**
|
||||||
* This method is used to retrieve the movies currently in theatres.
|
* This method is used to retrieve the movies currently in theatres.
|
||||||
*
|
*
|
||||||
* This is a curated list that will normally contain 100 movies. The default
|
* This is a curated list that will normally contain 100 movies. The default response will return 20 movies.
|
||||||
* response will return 20 movies.
|
|
||||||
*
|
*
|
||||||
* @param language
|
* @param language
|
||||||
* @param page
|
* @param page
|
||||||
@@ -552,8 +577,7 @@ public class TmdbMovies extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to retrieve the top rated movies that have over 10
|
* This method is used to retrieve the top rated movies that have over 10 votes on TMDb.
|
||||||
* votes on TMDb.
|
|
||||||
*
|
*
|
||||||
* The default response will return 20 movies.
|
* The default response will return 20 movies.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -46,7 +46,7 @@ import com.omertron.themoviedbapi.tools.Param;
|
|||||||
import com.omertron.themoviedbapi.tools.TmdbParameters;
|
import com.omertron.themoviedbapi.tools.TmdbParameters;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.yamj.api.common.exception.ApiExceptionType;
|
import org.yamj.api.common.exception.ApiExceptionType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,13 +79,19 @@ public class TmdbPeople extends AbstractMethod {
|
|||||||
parameters.add(Param.ID, personId);
|
parameters.add(Param.ID, personId);
|
||||||
parameters.add(Param.APPEND, appendToResponse);
|
parameters.add(Param.APPEND, appendToResponse);
|
||||||
|
|
||||||
|
// Switch combined credits for tv & movie.
|
||||||
|
String atr = (String) parameters.get(Param.APPEND);
|
||||||
|
if (StringUtils.isNotBlank(atr) && atr.contains("combined_credits")) {
|
||||||
|
atr = atr.replace("combined_credits", "tv_credits,movie_credits");
|
||||||
|
parameters.add(Param.APPEND, atr);
|
||||||
|
}
|
||||||
|
|
||||||
URL url = new ApiUrl(apiKey, MethodBase.PERSON).buildUrl(parameters);
|
URL url = new ApiUrl(apiKey, MethodBase.PERSON).buildUrl(parameters);
|
||||||
String webpage = httpTools.getRequest(url);
|
String webpage = httpTools.getRequest(url);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return MAPPER.readValue(webpage, PersonInfo.class);
|
return MAPPER.readValue(webpage, PersonInfo.class);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
LoggerFactory.getLogger("test").info("{}", ex);
|
|
||||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person info", url, ex);
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person info", url, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -107,7 +113,7 @@ public class TmdbPeople extends AbstractMethod {
|
|||||||
String webpage = httpTools.getRequest(url);
|
String webpage = httpTools.getRequest(url);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
TypeReference tr = new TypeReference<PersonCreditList<CreditMovieBasic>>() {
|
TypeReference<PersonCreditList<CreditMovieBasic>> tr = new TypeReference<PersonCreditList<CreditMovieBasic>>() {
|
||||||
};
|
};
|
||||||
return MAPPER.readValue(webpage, tr);
|
return MAPPER.readValue(webpage, tr);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -138,7 +144,7 @@ public class TmdbPeople extends AbstractMethod {
|
|||||||
String webpage = httpTools.getRequest(url);
|
String webpage = httpTools.getRequest(url);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
TypeReference tr = new TypeReference<PersonCreditList<CreditTVBasic>>() {
|
TypeReference<PersonCreditList<CreditTVBasic>> tr = new TypeReference<PersonCreditList<CreditTVBasic>>() {
|
||||||
};
|
};
|
||||||
return MAPPER.readValue(webpage, tr);
|
return MAPPER.readValue(webpage, tr);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -171,7 +177,7 @@ public class TmdbPeople extends AbstractMethod {
|
|||||||
try {
|
try {
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
mapper.addMixIn(PersonCreditList.class, PersonCreditsMixIn.class);
|
mapper.addMixIn(PersonCreditList.class, PersonCreditsMixIn.class);
|
||||||
TypeReference tr = new TypeReference<PersonCreditList<CreditBasic>>() {
|
TypeReference<PersonCreditList<CreditBasic>> tr = new TypeReference<PersonCreditList<CreditBasic>>() {
|
||||||
};
|
};
|
||||||
return mapper.readValue(webpage, tr);
|
return mapper.readValue(webpage, tr);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -216,7 +222,7 @@ public class TmdbPeople extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
||||||
ResultList<Artwork> results = new ResultList<Artwork>(wrapper.getAll(ArtworkType.PROFILE));
|
ResultList<Artwork> results = new ResultList<>(wrapper.getAll(ArtworkType.PROFILE));
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -25,7 +25,6 @@ import static com.omertron.themoviedbapi.methods.AbstractMethod.MAPPER;
|
|||||||
import com.omertron.themoviedbapi.model.collection.Collection;
|
import com.omertron.themoviedbapi.model.collection.Collection;
|
||||||
import com.omertron.themoviedbapi.model.company.Company;
|
import com.omertron.themoviedbapi.model.company.Company;
|
||||||
import com.omertron.themoviedbapi.model.keyword.Keyword;
|
import com.omertron.themoviedbapi.model.keyword.Keyword;
|
||||||
import com.omertron.themoviedbapi.model.list.UserList;
|
|
||||||
import com.omertron.themoviedbapi.model.media.MediaBasic;
|
import com.omertron.themoviedbapi.model.media.MediaBasic;
|
||||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||||
import com.omertron.themoviedbapi.model.person.PersonFind;
|
import com.omertron.themoviedbapi.model.person.PersonFind;
|
||||||
@@ -121,26 +120,6 @@ public class TmdbSearch extends AbstractMethod {
|
|||||||
return wrapper.getResultsList();
|
return wrapper.getResultsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Search for lists by name and description.
|
|
||||||
*
|
|
||||||
* @param query
|
|
||||||
* @param includeAdult
|
|
||||||
* @param page
|
|
||||||
* @return
|
|
||||||
* @throws MovieDbException
|
|
||||||
*/
|
|
||||||
public ResultList<UserList> searchList(String query, Integer page, Boolean includeAdult) throws MovieDbException {
|
|
||||||
TmdbParameters parameters = new TmdbParameters();
|
|
||||||
parameters.add(Param.QUERY, query);
|
|
||||||
parameters.add(Param.PAGE, page);
|
|
||||||
parameters.add(Param.INCLUDE_ADULT, includeAdult);
|
|
||||||
|
|
||||||
URL url = new ApiUrl(apiKey, MethodBase.SEARCH).subMethod(MethodSub.LIST).buildUrl(parameters);
|
|
||||||
WrapperGenericList<UserList> wrapper = processWrapper(getTypeReference(UserList.class), url, "list");
|
|
||||||
return wrapper.getResultsList();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search Movies This is a good starting point to start finding movies on TMDb.
|
* Search Movies This is a good starting point to start finding movies on TMDb.
|
||||||
*
|
*
|
||||||
@@ -203,13 +182,14 @@ public class TmdbSearch extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperMultiSearch wrapper = MAPPER.readValue(webpage, WrapperMultiSearch.class);
|
WrapperMultiSearch wrapper = MAPPER.readValue(webpage, WrapperMultiSearch.class);
|
||||||
ResultList<MediaBasic> results = new ResultList<MediaBasic>();
|
ResultList<MediaBasic> results = new ResultList<>();
|
||||||
results.getResults().addAll(wrapper.getResults());
|
results.getResults().addAll(wrapper.getResults());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get multi search", url, ex);
|
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get multi search", url, ex);
|
||||||
} }
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a good starting point to start finding people on TMDb.
|
* This is a good starting point to start finding people on TMDb.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -99,8 +99,7 @@ public class TmdbSeasons extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method lets users get the status of whether or not the TV episodes
|
* This method lets users get the status of whether or not the TV episodes of a season have been rated.
|
||||||
* of a season have been rated.
|
|
||||||
*
|
*
|
||||||
* A valid session id is required.
|
* A valid session id is required.
|
||||||
*
|
*
|
||||||
@@ -147,8 +146,7 @@ public class TmdbSeasons extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the external ids that we have stored for a TV season by season
|
* Get the external ids that we have stored for a TV season by season number.
|
||||||
* number.
|
|
||||||
*
|
*
|
||||||
* @param tvID
|
* @param tvID
|
||||||
* @param seasonNumber
|
* @param seasonNumber
|
||||||
@@ -194,7 +192,7 @@ public class TmdbSeasons extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
||||||
ResultList<Artwork> results = new ResultList<Artwork>(wrapper.getAll());
|
ResultList<Artwork> results = new ResultList<>(wrapper.getAll());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -203,8 +201,7 @@ public class TmdbSeasons extends AbstractMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the videos that have been added to a TV season (trailers, teasers,
|
* Get the videos that have been added to a TV season (trailers, teasers, etc...)
|
||||||
* etc...)
|
|
||||||
*
|
*
|
||||||
* @param tvID
|
* @param tvID
|
||||||
* @param seasonNumber
|
* @param seasonNumber
|
||||||
@@ -223,7 +220,7 @@ public class TmdbSeasons extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
|
WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
|
||||||
ResultList<Video> results = new ResultList<Video>(wrapper.getVideos());
|
ResultList<Video> results = new ResultList<>(wrapper.getVideos());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -32,7 +32,6 @@ import com.omertron.themoviedbapi.model.media.Translation;
|
|||||||
import com.omertron.themoviedbapi.model.media.Video;
|
import com.omertron.themoviedbapi.model.media.Video;
|
||||||
import com.omertron.themoviedbapi.model.person.ContentRating;
|
import com.omertron.themoviedbapi.model.person.ContentRating;
|
||||||
import com.omertron.themoviedbapi.model.person.ExternalID;
|
import com.omertron.themoviedbapi.model.person.ExternalID;
|
||||||
import com.omertron.themoviedbapi.model.tv.TVBasic;
|
|
||||||
import com.omertron.themoviedbapi.model.tv.TVInfo;
|
import com.omertron.themoviedbapi.model.tv.TVInfo;
|
||||||
import com.omertron.themoviedbapi.results.ResultList;
|
import com.omertron.themoviedbapi.results.ResultList;
|
||||||
import com.omertron.themoviedbapi.results.WrapperGenericList;
|
import com.omertron.themoviedbapi.results.WrapperGenericList;
|
||||||
@@ -231,7 +230,7 @@ public class TmdbTV extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
||||||
ResultList<Artwork> results = new ResultList<Artwork>(wrapper.getAll());
|
ResultList<Artwork> results = new ResultList<>(wrapper.getAll());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -327,7 +326,7 @@ public class TmdbTV extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperTranslations wrapper = MAPPER.readValue(webpage, WrapperTranslations.class);
|
WrapperTranslations wrapper = MAPPER.readValue(webpage, WrapperTranslations.class);
|
||||||
ResultList<Translation> results = new ResultList<Translation>(wrapper.getTranslations());
|
ResultList<Translation> results = new ResultList<>(wrapper.getTranslations());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -354,7 +353,7 @@ public class TmdbTV extends AbstractMethod {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
|
WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
|
||||||
ResultList<Video> results = new ResultList<Video>(wrapper.getVideos());
|
ResultList<Video> results = new ResultList<>(wrapper.getVideos());
|
||||||
wrapper.setResultProperties(results);
|
wrapper.setResultProperties(results);
|
||||||
return results;
|
return results;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@@ -390,13 +389,13 @@ public class TmdbTV extends AbstractMethod {
|
|||||||
* @return
|
* @return
|
||||||
* @throws com.omertron.themoviedbapi.MovieDbException
|
* @throws com.omertron.themoviedbapi.MovieDbException
|
||||||
*/
|
*/
|
||||||
public ResultList<TVBasic> getTVOnTheAir(Integer page, String language) throws MovieDbException {
|
public ResultList<TVInfo> getTVOnTheAir(Integer page, String language) throws MovieDbException {
|
||||||
TmdbParameters parameters = new TmdbParameters();
|
TmdbParameters parameters = new TmdbParameters();
|
||||||
parameters.add(Param.PAGE, page);
|
parameters.add(Param.PAGE, page);
|
||||||
parameters.add(Param.LANGUAGE, language);
|
parameters.add(Param.LANGUAGE, language);
|
||||||
|
|
||||||
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.ON_THE_AIR).buildUrl(parameters);
|
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.ON_THE_AIR).buildUrl(parameters);
|
||||||
WrapperGenericList<TVBasic> wrapper = processWrapper(getTypeReference(TVBasic.class), url, "on the air");
|
WrapperGenericList<TVInfo> wrapper = processWrapper(getTypeReference(TVInfo.class), url, "on the air");
|
||||||
return wrapper.getResultsList();
|
return wrapper.getResultsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,14 +410,14 @@ public class TmdbTV extends AbstractMethod {
|
|||||||
* @return
|
* @return
|
||||||
* @throws com.omertron.themoviedbapi.MovieDbException
|
* @throws com.omertron.themoviedbapi.MovieDbException
|
||||||
*/
|
*/
|
||||||
public ResultList<TVBasic> getTVAiringToday(Integer page, String language, String timezone) throws MovieDbException {
|
public ResultList<TVInfo> getTVAiringToday(Integer page, String language, String timezone) throws MovieDbException {
|
||||||
TmdbParameters parameters = new TmdbParameters();
|
TmdbParameters parameters = new TmdbParameters();
|
||||||
parameters.add(Param.PAGE, page);
|
parameters.add(Param.PAGE, page);
|
||||||
parameters.add(Param.LANGUAGE, language);
|
parameters.add(Param.LANGUAGE, language);
|
||||||
parameters.add(Param.TIMEZONE, timezone);
|
parameters.add(Param.TIMEZONE, timezone);
|
||||||
|
|
||||||
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.AIRING_TODAY).buildUrl(parameters);
|
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.AIRING_TODAY).buildUrl(parameters);
|
||||||
WrapperGenericList<TVBasic> wrapper = processWrapper(getTypeReference(TVBasic.class), url, "airing today");
|
WrapperGenericList<TVInfo> wrapper = processWrapper(getTypeReference(TVInfo.class), url, "airing today");
|
||||||
return wrapper.getResultsList();
|
return wrapper.getResultsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -435,13 +434,13 @@ public class TmdbTV extends AbstractMethod {
|
|||||||
* @return
|
* @return
|
||||||
* @throws com.omertron.themoviedbapi.MovieDbException
|
* @throws com.omertron.themoviedbapi.MovieDbException
|
||||||
*/
|
*/
|
||||||
public ResultList<TVBasic> getTVTopRated(Integer page, String language) throws MovieDbException {
|
public ResultList<TVInfo> getTVTopRated(Integer page, String language) throws MovieDbException {
|
||||||
TmdbParameters parameters = new TmdbParameters();
|
TmdbParameters parameters = new TmdbParameters();
|
||||||
parameters.add(Param.PAGE, page);
|
parameters.add(Param.PAGE, page);
|
||||||
parameters.add(Param.LANGUAGE, language);
|
parameters.add(Param.LANGUAGE, language);
|
||||||
|
|
||||||
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.TOP_RATED).buildUrl(parameters);
|
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.TOP_RATED).buildUrl(parameters);
|
||||||
WrapperGenericList<TVBasic> wrapper = processWrapper(getTypeReference(TVBasic.class), url, "top rated TV shows");
|
WrapperGenericList<TVInfo> wrapper = processWrapper(getTypeReference(TVInfo.class), url, "top rated TV shows");
|
||||||
return wrapper.getResultsList();
|
return wrapper.getResultsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,13 +452,13 @@ public class TmdbTV extends AbstractMethod {
|
|||||||
* @return
|
* @return
|
||||||
* @throws com.omertron.themoviedbapi.MovieDbException
|
* @throws com.omertron.themoviedbapi.MovieDbException
|
||||||
*/
|
*/
|
||||||
public ResultList<TVBasic> getTVPopular(Integer page, String language) throws MovieDbException {
|
public ResultList<TVInfo> getTVPopular(Integer page, String language) throws MovieDbException {
|
||||||
TmdbParameters parameters = new TmdbParameters();
|
TmdbParameters parameters = new TmdbParameters();
|
||||||
parameters.add(Param.PAGE, page);
|
parameters.add(Param.PAGE, page);
|
||||||
parameters.add(Param.LANGUAGE, language);
|
parameters.add(Param.LANGUAGE, language);
|
||||||
|
|
||||||
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.POPULAR).buildUrl(parameters);
|
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.POPULAR).buildUrl(parameters);
|
||||||
WrapperGenericList<TVBasic> wrapper = processWrapper(getTypeReference(TVBasic.class), url, "popular TV shows");
|
WrapperGenericList<TVInfo> wrapper = processWrapper(getTypeReference(TVInfo.class), url, "popular TV shows");
|
||||||
return wrapper.getResultsList();
|
return wrapper.getResultsList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -31,7 +31,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|||||||
*/
|
*/
|
||||||
public class AbstractIdName extends AbstractJsonMapping implements Serializable, Identification {
|
public class AbstractIdName extends AbstractJsonMapping implements Serializable, Identification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private int id;
|
private int id;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
*/
|
*/
|
||||||
public abstract class AbstractJsonMapping implements Serializable {
|
public abstract class AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(AbstractJsonMapping.class);
|
private static final Logger LOG = LoggerFactory.getLogger(AbstractJsonMapping.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,8 +45,8 @@ public abstract class AbstractJsonMapping implements Serializable {
|
|||||||
@JsonAnySetter
|
@JsonAnySetter
|
||||||
protected void handleUnknown(String key, Object value) {
|
protected void handleUnknown(String key, Object value) {
|
||||||
StringBuilder unknown = new StringBuilder(this.getClass().getSimpleName());
|
StringBuilder unknown = new StringBuilder(this.getClass().getSimpleName());
|
||||||
unknown.append(": Unknown property='").append(key);
|
unknown.append(": Unknown property='").append(key)
|
||||||
unknown.append("' value='").append(value).append("'");
|
.append("' value='").append(value).append("'");
|
||||||
|
|
||||||
LOG.trace(unknown.toString());
|
LOG.trace(unknown.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -26,7 +26,7 @@ import java.io.Serializable;
|
|||||||
@JsonRootName("certification")
|
@JsonRootName("certification")
|
||||||
public class Certification extends AbstractJsonMapping implements Serializable {
|
public class Certification extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
// Properties
|
// Properties
|
||||||
@JsonProperty("certification")
|
@JsonProperty("certification")
|
||||||
private String value;
|
private String value;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -33,7 +33,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class FindResults extends AbstractJsonMapping implements Serializable {
|
public class FindResults extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("movie_results")
|
@JsonProperty("movie_results")
|
||||||
private List<MovieBasic> movieResults;
|
private List<MovieBasic> movieResults;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -28,6 +28,6 @@ import java.io.Serializable;
|
|||||||
@JsonRootName("genre")
|
@JsonRootName("genre")
|
||||||
public class Genre extends AbstractIdName implements Serializable {
|
public class Genre extends AbstractIdName implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
// Nothing to override from the base class.
|
// Nothing to override from the base class.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -31,23 +31,23 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|||||||
@JsonRootName("spoken_language")
|
@JsonRootName("spoken_language")
|
||||||
public class Language extends AbstractJsonMapping implements Serializable {
|
public class Language extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("iso_639_1")
|
@JsonProperty("iso_639_1")
|
||||||
private String isoCode;
|
private String code;
|
||||||
@JsonProperty("name")
|
@JsonProperty("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
public String getIsoCode() {
|
public String getCode() {
|
||||||
return isoCode;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsoCode(String isoCode) {
|
public void setCode(String code) {
|
||||||
this.isoCode = isoCode;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
@@ -59,7 +59,7 @@ public class Language extends AbstractJsonMapping implements Serializable {
|
|||||||
if (obj instanceof Language) {
|
if (obj instanceof Language) {
|
||||||
final Language other = (Language) obj;
|
final Language other = (Language) obj;
|
||||||
return new EqualsBuilder()
|
return new EqualsBuilder()
|
||||||
.append(isoCode, other.isoCode)
|
.append(code, other.code)
|
||||||
.append(name, other.name)
|
.append(name, other.name)
|
||||||
.isEquals();
|
.isEquals();
|
||||||
} else {
|
} else {
|
||||||
@@ -70,7 +70,7 @@ public class Language extends AbstractJsonMapping implements Serializable {
|
|||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return new HashCodeBuilder()
|
return new HashCodeBuilder()
|
||||||
.append(isoCode)
|
.append(code)
|
||||||
.append(name)
|
.append(name)
|
||||||
.toHashCode();
|
.toHashCode();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
*/
|
*/
|
||||||
public class StatusCode extends AbstractJsonMapping {
|
public class StatusCode extends AbstractJsonMapping {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("status_code")
|
@JsonProperty("status_code")
|
||||||
private int code;
|
private int code;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -22,11 +22,10 @@ package com.omertron.themoviedbapi.model.account;
|
|||||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.omertron.themoviedbapi.interfaces.Identification;
|
import com.omertron.themoviedbapi.interfaces.Identification;
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
public class Account extends AbstractJsonMapping implements Serializable, Identification {
|
public class Account extends AbstractJsonMapping implements Identification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private int id;
|
private int id;
|
||||||
@@ -40,6 +39,8 @@ public class Account extends AbstractJsonMapping implements Serializable, Identi
|
|||||||
private String language;
|
private String language;
|
||||||
@JsonProperty("iso_3166_1")
|
@JsonProperty("iso_3166_1")
|
||||||
private String country;
|
private String country;
|
||||||
|
@JsonProperty("avatar")
|
||||||
|
private Avatar avatar;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
@@ -90,4 +91,12 @@ public class Account extends AbstractJsonMapping implements Serializable, Identi
|
|||||||
public void setCountry(String country) {
|
public void setCountry(String country) {
|
||||||
this.country = country;
|
this.country = country;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Avatar getAvatar() {
|
||||||
|
return avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvatar(Avatar avatar) {
|
||||||
|
this.avatar = avatar;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2016 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.account;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||||
|
|
||||||
|
public class Avatar extends AbstractJsonMapping {
|
||||||
|
|
||||||
|
@JsonProperty("gravatar")
|
||||||
|
private AvatarHash hash = null;
|
||||||
|
|
||||||
|
public String getHash() {
|
||||||
|
return hash == null ? "" : hash.getHash();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHash(AvatarHash hash) {
|
||||||
|
this.hash = hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2016 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.account;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||||
|
|
||||||
|
public class AvatarHash extends AbstractJsonMapping {
|
||||||
|
|
||||||
|
@JsonProperty("hash")
|
||||||
|
private String hash;
|
||||||
|
|
||||||
|
public String getHash() {
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHash(String hash) {
|
||||||
|
this.hash = hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -34,7 +34,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|||||||
*/
|
*/
|
||||||
public class Artwork extends AbstractJsonMapping implements Serializable {
|
public class Artwork extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private String id;
|
private String id;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -38,7 +38,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|||||||
*/
|
*/
|
||||||
public class ArtworkMedia extends Artwork implements Serializable {
|
public class ArtworkMedia extends Artwork implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
private MediaType mediaType;
|
private MediaType mediaType;
|
||||||
@JsonTypeInfo(
|
@JsonTypeInfo(
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -25,7 +25,7 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
public class TokenAuthorisation extends AbstractJsonMapping implements Serializable {
|
public class TokenAuthorisation extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
@JsonProperty("expires_at")
|
@JsonProperty("expires_at")
|
||||||
private String expires;
|
private String expires;
|
||||||
@JsonProperty("request_token")
|
@JsonProperty("request_token")
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -25,7 +25,7 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
public class TokenSession extends AbstractJsonMapping implements Serializable {
|
public class TokenSession extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
@JsonProperty("session_id")
|
@JsonProperty("session_id")
|
||||||
private String sessionId;
|
private String sessionId;
|
||||||
@JsonProperty("success")
|
@JsonProperty("success")
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -27,11 +27,11 @@ import java.util.List;
|
|||||||
|
|
||||||
public class ChangeKeyItem extends AbstractJsonMapping implements Serializable {
|
public class ChangeKeyItem extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
@JsonProperty("key")
|
@JsonProperty("key")
|
||||||
private String key;
|
private String key;
|
||||||
@JsonProperty("items")
|
@JsonProperty("items")
|
||||||
private List<ChangedItem> changedItems = new ArrayList<ChangedItem>();
|
private List<ChangedItem> changedItems = new ArrayList<>();
|
||||||
|
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return key;
|
return key;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -25,7 +25,7 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
public class ChangeListItem extends AbstractJsonMapping implements Serializable {
|
public class ChangeListItem extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private int id;
|
private int id;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -25,7 +25,7 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
public class ChangedItem extends AbstractJsonMapping implements Serializable {
|
public class ChangedItem extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private String id;
|
private String id;
|
||||||
@JsonProperty("action")
|
@JsonProperty("action")
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonRootName;
|
|||||||
import com.omertron.themoviedbapi.interfaces.Identification;
|
import com.omertron.themoviedbapi.interfaces.Identification;
|
||||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||||
@@ -34,7 +35,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|||||||
@JsonRootName("collection")
|
@JsonRootName("collection")
|
||||||
public class Collection extends AbstractJsonMapping implements Serializable, Identification {
|
public class Collection extends AbstractJsonMapping implements Serializable, Identification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private int id;
|
private int id;
|
||||||
@@ -48,6 +49,24 @@ public class Collection extends AbstractJsonMapping implements Serializable, Ide
|
|||||||
private String backdropPath;
|
private String backdropPath;
|
||||||
@JsonProperty("release_date")
|
@JsonProperty("release_date")
|
||||||
private String releaseDate;
|
private String releaseDate;
|
||||||
|
@JsonProperty("genre_ids")
|
||||||
|
private List<Integer> genreIds;
|
||||||
|
@JsonProperty("adult")
|
||||||
|
private boolean adult;
|
||||||
|
@JsonProperty("original_language")
|
||||||
|
private String originalLanguage;
|
||||||
|
@JsonProperty("original_title")
|
||||||
|
private String originalTitle;
|
||||||
|
@JsonProperty("overview")
|
||||||
|
private String overview;
|
||||||
|
@JsonProperty("video")
|
||||||
|
private boolean video;
|
||||||
|
@JsonProperty("popularity")
|
||||||
|
private float popularity;
|
||||||
|
@JsonProperty("vote_average")
|
||||||
|
private float voteAverage;
|
||||||
|
@JsonProperty("vote_count")
|
||||||
|
private int voteCount;
|
||||||
|
|
||||||
public String getBackdropPath() {
|
public String getBackdropPath() {
|
||||||
return backdropPath;
|
return backdropPath;
|
||||||
@@ -80,6 +99,18 @@ public class Collection extends AbstractJsonMapping implements Serializable, Ide
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Integer> getGenreIds() {
|
||||||
|
return genreIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAdult() {
|
||||||
|
return adult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalLanguage() {
|
||||||
|
return originalLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
public void setBackdropPath(String backdropPath) {
|
public void setBackdropPath(String backdropPath) {
|
||||||
this.backdropPath = backdropPath;
|
this.backdropPath = backdropPath;
|
||||||
}
|
}
|
||||||
@@ -105,6 +136,66 @@ public class Collection extends AbstractJsonMapping implements Serializable, Ide
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setGenreIds(List<Integer> genreIds) {
|
||||||
|
this.genreIds = genreIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdult(boolean adult) {
|
||||||
|
this.adult = adult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginalLanguage(String originalLanguage) {
|
||||||
|
this.originalLanguage = originalLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalTitle() {
|
||||||
|
return originalTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginalTitle(String originalTitle) {
|
||||||
|
this.originalTitle = originalTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOverview() {
|
||||||
|
return overview;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOverview(String overview) {
|
||||||
|
this.overview = overview;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isVideo() {
|
||||||
|
return video;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVideo(boolean video) {
|
||||||
|
this.video = video;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getPopularity() {
|
||||||
|
return popularity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPopularity(float popularity) {
|
||||||
|
this.popularity = popularity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getVoteAverage() {
|
||||||
|
return voteAverage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVoteAverage(float voteAverage) {
|
||||||
|
this.voteAverage = voteAverage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getVoteCount() {
|
||||||
|
return voteCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVoteCount(int voteCount) {
|
||||||
|
this.voteCount = voteCount;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof Collection) {
|
if (obj instanceof Collection) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -32,7 +32,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class CollectionInfo extends AbstractJsonMapping implements Serializable, Identification {
|
public class CollectionInfo extends AbstractJsonMapping implements Serializable, Identification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private int id;
|
private int id;
|
||||||
@@ -45,7 +45,7 @@ public class CollectionInfo extends AbstractJsonMapping implements Serializable,
|
|||||||
@JsonProperty("backdrop_path")
|
@JsonProperty("backdrop_path")
|
||||||
private String backdropPath;
|
private String backdropPath;
|
||||||
@JsonProperty("parts")
|
@JsonProperty("parts")
|
||||||
private List<Collection> parts = new ArrayList<Collection>();
|
private List<Collection> parts = new ArrayList<>();
|
||||||
|
|
||||||
public String getBackdropPath() {
|
public String getBackdropPath() {
|
||||||
return backdropPath;
|
return backdropPath;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -32,7 +32,7 @@ import static org.apache.commons.lang3.StringUtils.EMPTY;
|
|||||||
*/
|
*/
|
||||||
public class Company extends AbstractJsonMapping implements Serializable, Identification {
|
public class Company extends AbstractJsonMapping implements Serializable, Identification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
// Properties
|
// Properties
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private int id = 0;
|
private int id = 0;
|
||||||
@@ -48,6 +48,8 @@ public class Company extends AbstractJsonMapping implements Serializable, Identi
|
|||||||
private String logoPath = EMPTY;
|
private String logoPath = EMPTY;
|
||||||
@JsonProperty("parent_company")
|
@JsonProperty("parent_company")
|
||||||
private Company parentCompany = null;
|
private Company parentCompany = null;
|
||||||
|
@JsonProperty("origin_country")
|
||||||
|
private String originCountry;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
@@ -114,4 +116,13 @@ public class Company extends AbstractJsonMapping implements Serializable, Identi
|
|||||||
parent.setLogoPath(logoPath);
|
parent.setLogoPath(logoPath);
|
||||||
this.parentCompany = parent;
|
this.parentCompany = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getOriginCountry() {
|
||||||
|
return originCountry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginCountry(String originCountry) {
|
||||||
|
this.originCountry = originCountry;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -34,7 +34,7 @@ import org.yamj.api.common.exception.ApiExceptionType;
|
|||||||
*/
|
*/
|
||||||
public class Configuration extends AbstractJsonMapping implements Serializable {
|
public class Configuration extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("base_url")
|
@JsonProperty("base_url")
|
||||||
private String baseUrl;
|
private String baseUrl;
|
||||||
@@ -199,8 +199,7 @@ public class Configuration extends AbstractJsonMapping implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder(getBaseUrl());
|
StringBuilder sb = new StringBuilder(getBaseUrl());
|
||||||
sb.append(requiredSize);
|
sb.append(requiredSize).append(imagePath);
|
||||||
sb.append(imagePath);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return new URL(sb.toString());
|
return new URL(sb.toString());
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -26,11 +26,11 @@ import java.util.List;
|
|||||||
|
|
||||||
public class JobDepartment extends AbstractJsonMapping implements Serializable {
|
public class JobDepartment extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
// Properties
|
// Properties
|
||||||
@JsonProperty("department")
|
@JsonProperty("department")
|
||||||
private String department;
|
private String department;
|
||||||
@JsonProperty("job_list")
|
@JsonProperty("jobs")
|
||||||
private List<String> jobs;
|
private List<String> jobs;
|
||||||
|
|
||||||
public String getDepartment() {
|
public String getDepartment() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -27,13 +27,14 @@ import com.omertron.themoviedbapi.enumeration.MediaType;
|
|||||||
import com.omertron.themoviedbapi.interfaces.Identification;
|
import com.omertron.themoviedbapi.interfaces.Identification;
|
||||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author stuart.boston
|
* @author stuart.boston
|
||||||
*/
|
*/
|
||||||
public class CreditBasic extends AbstractJsonMapping implements Serializable, Identification {
|
public class CreditBasic extends AbstractJsonMapping implements Serializable, Identification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
private CreditType creditType;
|
private CreditType creditType;
|
||||||
private MediaType mediaType;
|
private MediaType mediaType;
|
||||||
@@ -44,6 +45,20 @@ public class CreditBasic extends AbstractJsonMapping implements Serializable, Id
|
|||||||
private int id;
|
private int id;
|
||||||
@JsonProperty("poster_path")
|
@JsonProperty("poster_path")
|
||||||
private String artworkPath;
|
private String artworkPath;
|
||||||
|
@JsonProperty("backdrop_path")
|
||||||
|
private String backdropPath;
|
||||||
|
@JsonProperty("genre_ids")
|
||||||
|
private List<Integer> genreIds;
|
||||||
|
@JsonProperty("original_language")
|
||||||
|
private String originalLanguage;
|
||||||
|
@JsonProperty("overview")
|
||||||
|
private String overview;
|
||||||
|
@JsonProperty("popularity")
|
||||||
|
private float popularity;
|
||||||
|
@JsonProperty("vote_average")
|
||||||
|
private float voteAverage;
|
||||||
|
@JsonProperty("vote_count")
|
||||||
|
private int voteCount;
|
||||||
|
|
||||||
//cast
|
//cast
|
||||||
@JsonProperty("character")
|
@JsonProperty("character")
|
||||||
@@ -71,7 +86,7 @@ public class CreditBasic extends AbstractJsonMapping implements Serializable, Id
|
|||||||
this.mediaType = MediaType.fromString(mediaType);
|
this.mediaType = MediaType.fromString(mediaType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMediaType(MediaType mediaType) {
|
public final void setMediaType(MediaType mediaType) {
|
||||||
this.mediaType = mediaType;
|
this.mediaType = mediaType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,4 +143,60 @@ public class CreditBasic extends AbstractJsonMapping implements Serializable, Id
|
|||||||
setCreditType(CreditType.CREW);
|
setCreditType(CreditType.CREW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getBackdropPath() {
|
||||||
|
return backdropPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackdropPath(String backdropPath) {
|
||||||
|
this.backdropPath = backdropPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getGenreIds() {
|
||||||
|
return genreIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGenreIds(List<Integer> genreIds) {
|
||||||
|
this.genreIds = genreIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalLanguage() {
|
||||||
|
return originalLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginalLanguage(String originalLanguage) {
|
||||||
|
this.originalLanguage = originalLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOverview() {
|
||||||
|
return overview;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOverview(String overview) {
|
||||||
|
this.overview = overview;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getPopularity() {
|
||||||
|
return popularity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPopularity(float popularity) {
|
||||||
|
this.popularity = popularity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getVoteAverage() {
|
||||||
|
return voteAverage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVoteAverage(float voteAverage) {
|
||||||
|
this.voteAverage = voteAverage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getVoteCount() {
|
||||||
|
return voteCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVoteCount(int voteCount) {
|
||||||
|
this.voteCount = voteCount;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -28,7 +28,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class CreditMovieBasic extends CreditBasic implements Serializable {
|
public class CreditMovieBasic extends CreditBasic implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("adult")
|
@JsonProperty("adult")
|
||||||
private boolean adult;
|
private boolean adult;
|
||||||
@@ -38,6 +38,8 @@ public class CreditMovieBasic extends CreditBasic implements Serializable {
|
|||||||
private String releaseDate;
|
private String releaseDate;
|
||||||
@JsonProperty("title")
|
@JsonProperty("title")
|
||||||
private String title;
|
private String title;
|
||||||
|
@JsonProperty("video")
|
||||||
|
private boolean video;
|
||||||
|
|
||||||
public CreditMovieBasic() {
|
public CreditMovieBasic() {
|
||||||
setMediaType(MediaType.MOVIE);
|
setMediaType(MediaType.MOVIE);
|
||||||
@@ -75,4 +77,12 @@ public class CreditMovieBasic extends CreditBasic implements Serializable {
|
|||||||
this.title = title;
|
this.title = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isVideo() {
|
||||||
|
return video;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVideo(boolean video) {
|
||||||
|
this.video = video;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -28,7 +28,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class CreditTVBasic extends CreditBasic implements Serializable {
|
public class CreditTVBasic extends CreditBasic implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("episode_count")
|
@JsonProperty("episode_count")
|
||||||
private int episodeCount;
|
private int episodeCount;
|
||||||
@@ -38,6 +38,8 @@ public class CreditTVBasic extends CreditBasic implements Serializable {
|
|||||||
private String name;
|
private String name;
|
||||||
@JsonProperty("original_name")
|
@JsonProperty("original_name")
|
||||||
private String originalName;
|
private String originalName;
|
||||||
|
@JsonProperty("origin_country")
|
||||||
|
private String originCountry;
|
||||||
|
|
||||||
public CreditTVBasic() {
|
public CreditTVBasic() {
|
||||||
setMediaType(MediaType.TV);
|
setMediaType(MediaType.TV);
|
||||||
@@ -75,4 +77,12 @@ public class CreditTVBasic extends CreditBasic implements Serializable {
|
|||||||
this.originalName = originalName;
|
this.originalName = originalName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getOriginCountry() {
|
||||||
|
return originCountry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginCountry(String originCountry) {
|
||||||
|
this.originCountry = originCountry;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -30,7 +30,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class MediaCredit extends AbstractJsonMapping implements Serializable, Identification {
|
public class MediaCredit extends AbstractJsonMapping implements Serializable, Identification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("credit_id")
|
@JsonProperty("credit_id")
|
||||||
private String creditId;
|
private String creditId;
|
||||||
@@ -40,6 +40,8 @@ public class MediaCredit extends AbstractJsonMapping implements Serializable, Id
|
|||||||
private String artworkPath;
|
private String artworkPath;
|
||||||
@JsonProperty("name")
|
@JsonProperty("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
@JsonProperty("gender")
|
||||||
|
private int gender;
|
||||||
|
|
||||||
public String getCreditId() {
|
public String getCreditId() {
|
||||||
return creditId;
|
return creditId;
|
||||||
@@ -75,4 +77,12 @@ public class MediaCredit extends AbstractJsonMapping implements Serializable, Id
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getGender() {
|
||||||
|
return gender;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGender(int gender) {
|
||||||
|
this.gender = gender;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -28,7 +28,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class MediaCreditCast extends MediaCredit implements Serializable {
|
public class MediaCreditCast extends MediaCredit implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("cast_id")
|
@JsonProperty("cast_id")
|
||||||
private int castId = 0;
|
private int castId = 0;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -28,7 +28,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class MediaCreditCrew extends MediaCredit implements Serializable {
|
public class MediaCreditCrew extends MediaCredit implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("department")
|
@JsonProperty("department")
|
||||||
private String department;
|
private String department;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -25,7 +25,7 @@ import com.omertron.themoviedbapi.tools.TmdbParameters;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a discover object for use in the MovieDbApi
|
* Generate a discover object for use in the MovieDbApi
|
||||||
* <p/>
|
* <p>
|
||||||
* This allows you to just add the search components you are concerned with
|
* This allows you to just add the search components you are concerned with
|
||||||
*
|
*
|
||||||
* @author stuart.boston
|
* @author stuart.boston
|
||||||
@@ -39,7 +39,7 @@ public class Discover {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the parameters
|
* Get the parameters
|
||||||
* <p/>
|
* <p>
|
||||||
* This will be used to construct the URL in the API
|
* This will be used to construct the URL in the API
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@@ -137,6 +137,33 @@ public class Discover {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The primary minimum release to include.
|
||||||
|
* <p>
|
||||||
|
* Expected format is YYYY-MM-DD.
|
||||||
|
*
|
||||||
|
* @param primaryReleaseDateGte
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Discover primaryReleaseDateGte(String primaryReleaseDateGte) {
|
||||||
|
params.add(Param.PRIMARY_RELEASE_DATE_GTE, primaryReleaseDateGte);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The primary maximum release to include.
|
||||||
|
* <p>
|
||||||
|
* Expected format is YYYY-MM-DD.
|
||||||
|
*
|
||||||
|
* @param primaryReleaseDateLte
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Discover primaryReleaseDateLte(String primaryReleaseDateLte) {
|
||||||
|
params.add(Param.PRIMARY_RELEASE_DATE_LTE, primaryReleaseDateLte);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Only include movies that are equal to, or have a vote count higher than this value
|
* Only include movies that are equal to, or have a vote count higher than this value
|
||||||
*
|
*
|
||||||
@@ -183,7 +210,7 @@ public class Discover {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The minimum release to include.
|
* The minimum release to include.
|
||||||
* <p/>
|
* <p>
|
||||||
* Expected format is YYYY-MM-DD.
|
* Expected format is YYYY-MM-DD.
|
||||||
*
|
*
|
||||||
* @param releaseDateGte
|
* @param releaseDateGte
|
||||||
@@ -196,7 +223,7 @@ public class Discover {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum release to include.
|
* The maximum release to include.
|
||||||
* <p/>
|
* <p>
|
||||||
* Expected format is YYYY-MM-DD.
|
* Expected format is YYYY-MM-DD.
|
||||||
*
|
*
|
||||||
* @param releaseDateLte
|
* @param releaseDateLte
|
||||||
@@ -209,9 +236,9 @@ public class Discover {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Only include movies with certifications for a specific country.
|
* Only include movies with certifications for a specific country.
|
||||||
* <p/>
|
* <p>
|
||||||
* When this value is specified, 'certificationLte' is required.
|
* When this value is specified, 'certificationLte' is required.
|
||||||
* <p/>
|
* <p>
|
||||||
* A ISO 3166-1 is expected
|
* A ISO 3166-1 is expected
|
||||||
*
|
*
|
||||||
* @param certificationCountry
|
* @param certificationCountry
|
||||||
@@ -224,7 +251,7 @@ public class Discover {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Only include movies with this certification and lower.
|
* Only include movies with this certification and lower.
|
||||||
* <p/>
|
* <p>
|
||||||
* Expected value is a valid certification for the specified 'certificationCountry'.
|
* Expected value is a valid certification for the specified 'certificationCountry'.
|
||||||
*
|
*
|
||||||
* @param certificationLte
|
* @param certificationLte
|
||||||
@@ -337,11 +364,11 @@ public class Discover {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Only include movies with the specified genres.
|
* Only include movies with the specified genres.
|
||||||
* <p/>
|
* <p>
|
||||||
* Expected value is an integer (the id of a genre).
|
* Expected value is an integer (the id of a genre).
|
||||||
* <p/>
|
* <p>
|
||||||
* Multiple values can be specified.
|
* Multiple values can be specified.
|
||||||
* <p/>
|
* <p>
|
||||||
* Comma separated indicates an 'AND' query, while a pipe (|) separated value indicates an 'OR'
|
* Comma separated indicates an 'AND' query, while a pipe (|) separated value indicates an 'OR'
|
||||||
*
|
*
|
||||||
* @param withGenres
|
* @param withGenres
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -29,6 +29,6 @@ import java.io.Serializable;
|
|||||||
@JsonRootName("keyword")
|
@JsonRootName("keyword")
|
||||||
public class Keyword extends AbstractIdName implements Serializable {
|
public class Keyword extends AbstractIdName implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
// Nothing to override from the base class.
|
// Nothing to override from the base class.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -33,7 +33,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class ListItem<T> extends AbstractJsonMapping implements Serializable {
|
public class ListItem<T> extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private String id;
|
private String id;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -21,20 +21,29 @@ package com.omertron.themoviedbapi.model.list;
|
|||||||
|
|
||||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Holger Brandl
|
* @author Holger Brandl
|
||||||
*/
|
*/
|
||||||
public class ListItemStatus extends AbstractJsonMapping implements Serializable {
|
public class ListItemStatus extends AbstractJsonMapping {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 101L;
|
||||||
|
|
||||||
|
@JsonProperty("id")
|
||||||
|
private String id;
|
||||||
@JsonProperty("status_code")
|
@JsonProperty("status_code")
|
||||||
private int statusCode;
|
private int statusCode;
|
||||||
@JsonProperty("item_present")
|
@JsonProperty("item_present")
|
||||||
private boolean itemPresent;
|
private boolean itemPresent;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
public int getStatusCode() {
|
public int getStatusCode() {
|
||||||
return statusCode;
|
return statusCode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -26,6 +26,8 @@ public class ListStatusCode extends StatusCode {
|
|||||||
|
|
||||||
@JsonProperty("list_id")
|
@JsonProperty("list_id")
|
||||||
private String listId;
|
private String listId;
|
||||||
|
@JsonProperty("success")
|
||||||
|
private boolean success;
|
||||||
|
|
||||||
public String getListId() {
|
public String getListId() {
|
||||||
return listId;
|
return listId;
|
||||||
@@ -34,4 +36,13 @@ public class ListStatusCode extends StatusCode {
|
|||||||
public void setListId(String listId) {
|
public void setListId(String listId) {
|
||||||
this.listId = listId;
|
this.listId = listId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuccess(boolean success) {
|
||||||
|
this.success = success;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -30,7 +30,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class UserList extends AbstractJsonMapping implements Serializable {
|
public class UserList extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private String id;
|
private String id;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -29,12 +29,14 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|||||||
*/
|
*/
|
||||||
public class AlternativeTitle implements Serializable {
|
public class AlternativeTitle implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("iso_3166_1")
|
@JsonProperty("iso_3166_1")
|
||||||
private String country;
|
private String country;
|
||||||
@JsonProperty("title")
|
@JsonProperty("title")
|
||||||
private String title;
|
private String title;
|
||||||
|
@JsonProperty("type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
public String getCountry() {
|
public String getCountry() {
|
||||||
return country;
|
return country;
|
||||||
@@ -52,6 +54,14 @@ public class AlternativeTitle implements Serializable {
|
|||||||
this.title = title;
|
this.title = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof AlternativeTitle) {
|
if (obj instanceof AlternativeTitle) {
|
||||||
@@ -59,6 +69,7 @@ public class AlternativeTitle implements Serializable {
|
|||||||
return new EqualsBuilder()
|
return new EqualsBuilder()
|
||||||
.append(country, other.country)
|
.append(country, other.country)
|
||||||
.append(title, other.title)
|
.append(title, other.title)
|
||||||
|
.append(type, other.type)
|
||||||
.isEquals();
|
.isEquals();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -70,6 +81,7 @@ public class AlternativeTitle implements Serializable {
|
|||||||
return new HashCodeBuilder()
|
return new HashCodeBuilder()
|
||||||
.append(country)
|
.append(country)
|
||||||
.append(title)
|
.append(title)
|
||||||
|
.append(type)
|
||||||
.toHashCode();
|
.toHashCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -33,7 +33,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class MediaBasic extends AbstractJsonMapping implements Serializable, Identification {
|
public class MediaBasic extends AbstractJsonMapping implements Serializable, Identification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private int id;
|
private int id;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -33,7 +33,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class MediaCreditList extends AbstractJsonMapping implements Serializable, Identification {
|
public class MediaCreditList extends AbstractJsonMapping implements Serializable, Identification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private int id = 0;
|
private int id = 0;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -31,7 +31,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class MediaState extends AbstractJsonMapping implements Serializable, Identification {
|
public class MediaState extends AbstractJsonMapping implements Serializable, Identification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private int id;
|
private int id;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -29,7 +29,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class RatedValue extends AbstractJsonMapping implements Serializable {
|
public class RatedValue extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("value")
|
@JsonProperty("value")
|
||||||
private float value = -1f;
|
private float value = -1f;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -32,7 +32,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|||||||
*/
|
*/
|
||||||
public class Trailer extends AbstractJsonMapping implements Serializable {
|
public class Trailer extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("name")
|
@JsonProperty("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -32,39 +32,49 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||||||
*/
|
*/
|
||||||
public class Translation extends AbstractJsonMapping implements Serializable {
|
public class Translation extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("english_name")
|
@JsonProperty("english_name")
|
||||||
private String englishName;
|
private String englishName;
|
||||||
@JsonProperty("iso_639_1")
|
@JsonProperty("iso_639_1")
|
||||||
private String isoCode;
|
private String language;
|
||||||
@JsonProperty("name")
|
@JsonProperty("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
@JsonProperty("iso_3166_1")
|
||||||
|
private String country;
|
||||||
|
|
||||||
public String getEnglishName() {
|
public String getEnglishName() {
|
||||||
return englishName;
|
return englishName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIsoCode() {
|
public String getLanguage() {
|
||||||
return isoCode;
|
return language;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCountry() {
|
||||||
|
return country;
|
||||||
|
}
|
||||||
|
|
||||||
public void setEnglishName(String englishName) {
|
public void setEnglishName(String englishName) {
|
||||||
this.englishName = englishName;
|
this.englishName = englishName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsoCode(String isoCode) {
|
public void setLanguage(String language) {
|
||||||
this.isoCode = isoCode;
|
this.language = language;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCountry(String country) {
|
||||||
|
this.country = country;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof Translation) {
|
if (obj instanceof Translation) {
|
||||||
@@ -72,7 +82,7 @@ public class Translation extends AbstractJsonMapping implements Serializable {
|
|||||||
return new EqualsBuilder()
|
return new EqualsBuilder()
|
||||||
.append(name, other.name)
|
.append(name, other.name)
|
||||||
.append(englishName, other.englishName)
|
.append(englishName, other.englishName)
|
||||||
.append(isoCode, other.isoCode)
|
.append(language, other.language)
|
||||||
.isEquals();
|
.isEquals();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -83,7 +93,7 @@ public class Translation extends AbstractJsonMapping implements Serializable {
|
|||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return new HashCodeBuilder()
|
return new HashCodeBuilder()
|
||||||
.append(englishName)
|
.append(englishName)
|
||||||
.append(isoCode)
|
.append(language)
|
||||||
.append(name)
|
.append(name)
|
||||||
.toHashCode();
|
.toHashCode();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -32,12 +32,10 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|||||||
*/
|
*/
|
||||||
public class Video extends AbstractJsonMapping implements Serializable {
|
public class Video extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
private String id;
|
private String id;
|
||||||
@JsonProperty("iso_639_1")
|
|
||||||
private String language;
|
|
||||||
@JsonProperty("key")
|
@JsonProperty("key")
|
||||||
private String key;
|
private String key;
|
||||||
@JsonProperty("name")
|
@JsonProperty("name")
|
||||||
@@ -48,6 +46,10 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
|||||||
private int size;
|
private int size;
|
||||||
@JsonProperty("type")
|
@JsonProperty("type")
|
||||||
private String type;
|
private String type;
|
||||||
|
@JsonProperty("iso_639_1")
|
||||||
|
private String language;
|
||||||
|
@JsonProperty("iso_3166_1")
|
||||||
|
private String country;
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
@@ -77,6 +79,10 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
|||||||
return language;
|
return language;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCountry() {
|
||||||
|
return country;
|
||||||
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
public void setId(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
@@ -105,6 +111,10 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
|||||||
this.language = language;
|
this.language = language;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCountry(String country) {
|
||||||
|
this.country = country;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof Video) {
|
if (obj instanceof Video) {
|
||||||
@@ -115,6 +125,7 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
|||||||
.append(size, other.size)
|
.append(size, other.size)
|
||||||
.append(key, other.key)
|
.append(key, other.key)
|
||||||
.append(language, other.language)
|
.append(language, other.language)
|
||||||
|
.append(country, other.country)
|
||||||
.isEquals();
|
.isEquals();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -130,6 +141,7 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
|||||||
.append(key)
|
.append(key)
|
||||||
.append(site)
|
.append(site)
|
||||||
.append(language)
|
.append(language)
|
||||||
|
.append(country)
|
||||||
.toHashCode();
|
.toHashCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
import com.omertron.themoviedbapi.enumeration.MediaType;
|
import com.omertron.themoviedbapi.enumeration.MediaType;
|
||||||
import com.omertron.themoviedbapi.model.media.MediaBasic;
|
import com.omertron.themoviedbapi.model.media.MediaBasic;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic Movie information
|
* Basic Movie information
|
||||||
@@ -31,8 +32,10 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class MovieBasic extends MediaBasic implements Serializable {
|
public class MovieBasic extends MediaBasic implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
|
@JsonProperty("_id")
|
||||||
|
private String mediaId;
|
||||||
@JsonProperty("adult")
|
@JsonProperty("adult")
|
||||||
private boolean adult;
|
private boolean adult;
|
||||||
@JsonProperty("original_title")
|
@JsonProperty("original_title")
|
||||||
@@ -45,11 +48,27 @@ public class MovieBasic extends MediaBasic implements Serializable {
|
|||||||
private Boolean video = null;
|
private Boolean video = null;
|
||||||
@JsonProperty("rating")
|
@JsonProperty("rating")
|
||||||
private float userRating = -1f;
|
private float userRating = -1f;
|
||||||
|
@JsonProperty("genre_ids")
|
||||||
|
private List<Integer> genreIds;
|
||||||
|
@JsonProperty("original_language")
|
||||||
|
private String originalLanguage;
|
||||||
|
@JsonProperty("overview")
|
||||||
|
private String overview;
|
||||||
|
@JsonProperty("revenue")
|
||||||
|
private long revenue = 0L;
|
||||||
|
|
||||||
public MovieBasic() {
|
public MovieBasic() {
|
||||||
super.setMediaType(MediaType.MOVIE);
|
super.setMediaType(MediaType.MOVIE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMediaId() {
|
||||||
|
return mediaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMediaId(String mediaId) {
|
||||||
|
this.mediaId = mediaId;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isAdult() {
|
public boolean isAdult() {
|
||||||
return adult;
|
return adult;
|
||||||
}
|
}
|
||||||
@@ -86,7 +105,7 @@ public class MovieBasic extends MediaBasic implements Serializable {
|
|||||||
return video;
|
return video;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVideo(boolean video) {
|
public void setVideo(Boolean video) {
|
||||||
this.video = video;
|
this.video = video;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,4 +116,36 @@ public class MovieBasic extends MediaBasic implements Serializable {
|
|||||||
public void setUserRating(float userRating) {
|
public void setUserRating(float userRating) {
|
||||||
this.userRating = userRating;
|
this.userRating = userRating;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Integer> getGenreIds() {
|
||||||
|
return genreIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGenreIds(List<Integer> genreIds) {
|
||||||
|
this.genreIds = genreIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalLanguage() {
|
||||||
|
return originalLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginalLanguage(String originalLanguage) {
|
||||||
|
this.originalLanguage = originalLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOverview() {
|
||||||
|
return overview;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOverview(String overview) {
|
||||||
|
this.overview = overview;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getRevenue() {
|
||||||
|
return revenue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRevenue(long revenue) {
|
||||||
|
this.revenue = revenue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -53,13 +53,13 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Movie Bean
|
* Movie Info
|
||||||
*
|
*
|
||||||
* @author stuart.boston
|
* @author stuart.boston
|
||||||
*/
|
*/
|
||||||
public class MovieInfo extends MovieBasic implements Serializable, Identification, AppendToResponse<MovieMethod> {
|
public class MovieInfo extends MovieBasic implements Serializable, Identification, AppendToResponse<MovieMethod> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("belongs_to_collection")
|
@JsonProperty("belongs_to_collection")
|
||||||
private Collection belongsToCollection;
|
private Collection belongsToCollection;
|
||||||
@@ -71,18 +71,12 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
|||||||
private String homepage;
|
private String homepage;
|
||||||
@JsonProperty("imdb_id")
|
@JsonProperty("imdb_id")
|
||||||
private String imdbID;
|
private String imdbID;
|
||||||
@JsonProperty("overview")
|
|
||||||
private String overview;
|
|
||||||
@JsonProperty("production_companies")
|
@JsonProperty("production_companies")
|
||||||
private List<ProductionCompany> productionCompanies = Collections.emptyList();
|
private List<ProductionCompany> productionCompanies = Collections.emptyList();
|
||||||
@JsonProperty("production_countries")
|
@JsonProperty("production_countries")
|
||||||
private List<ProductionCountry> productionCountries = Collections.emptyList();
|
private List<ProductionCountry> productionCountries = Collections.emptyList();
|
||||||
@JsonProperty("revenue")
|
|
||||||
private long revenue;
|
|
||||||
@JsonProperty("runtime")
|
@JsonProperty("runtime")
|
||||||
private int runtime;
|
private int runtime;
|
||||||
@JsonProperty("original_language")
|
|
||||||
private String originalLanguage;
|
|
||||||
@JsonProperty("spoken_languages")
|
@JsonProperty("spoken_languages")
|
||||||
private List<Language> spokenLanguages = Collections.emptyList();
|
private List<Language> spokenLanguages = Collections.emptyList();
|
||||||
@JsonProperty("tagline")
|
@JsonProperty("tagline")
|
||||||
@@ -100,6 +94,7 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
|||||||
private List<Video> videos = Collections.emptyList();
|
private List<Video> videos = Collections.emptyList();
|
||||||
private List<Translation> translations = Collections.emptyList();
|
private List<Translation> translations = Collections.emptyList();
|
||||||
private List<MovieInfo> similarMovies = Collections.emptyList();
|
private List<MovieInfo> similarMovies = Collections.emptyList();
|
||||||
|
private List<MovieInfo> recommendations = Collections.emptyList();
|
||||||
private List<Review> reviews = Collections.emptyList();
|
private List<Review> reviews = Collections.emptyList();
|
||||||
private List<UserList> lists = Collections.emptyList();
|
private List<UserList> lists = Collections.emptyList();
|
||||||
private List<ChangeKeyItem> changes = Collections.emptyList();
|
private List<ChangeKeyItem> changes = Collections.emptyList();
|
||||||
@@ -125,10 +120,6 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
|||||||
return imdbID;
|
return imdbID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOverview() {
|
|
||||||
return overview;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ProductionCompany> getProductionCompanies() {
|
public List<ProductionCompany> getProductionCompanies() {
|
||||||
return productionCompanies;
|
return productionCompanies;
|
||||||
}
|
}
|
||||||
@@ -137,10 +128,6 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
|||||||
return productionCountries;
|
return productionCountries;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getRevenue() {
|
|
||||||
return revenue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRuntime() {
|
public int getRuntime() {
|
||||||
return runtime;
|
return runtime;
|
||||||
}
|
}
|
||||||
@@ -156,10 +143,6 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
|||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOriginalLanguage() {
|
|
||||||
return originalLanguage;
|
|
||||||
}
|
|
||||||
// </editor-fold>
|
// </editor-fold>
|
||||||
|
|
||||||
// <editor-fold defaultstate="collapsed" desc="Setter methods">
|
// <editor-fold defaultstate="collapsed" desc="Setter methods">
|
||||||
@@ -183,10 +166,6 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
|||||||
this.imdbID = imdbID;
|
this.imdbID = imdbID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOverview(String overview) {
|
|
||||||
this.overview = overview;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProductionCompanies(List<ProductionCompany> productionCompanies) {
|
public void setProductionCompanies(List<ProductionCompany> productionCompanies) {
|
||||||
this.productionCompanies = productionCompanies;
|
this.productionCompanies = productionCompanies;
|
||||||
}
|
}
|
||||||
@@ -195,10 +174,6 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
|||||||
this.productionCountries = productionCountries;
|
this.productionCountries = productionCountries;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRevenue(long revenue) {
|
|
||||||
this.revenue = revenue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRuntime(int runtime) {
|
public void setRuntime(int runtime) {
|
||||||
this.runtime = runtime;
|
this.runtime = runtime;
|
||||||
}
|
}
|
||||||
@@ -214,10 +189,6 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
|||||||
public void setStatus(String status) {
|
public void setStatus(String status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOriginalLanguage(String originalLanguage) {
|
|
||||||
this.originalLanguage = originalLanguage;
|
|
||||||
}
|
|
||||||
// </editor-fold>
|
// </editor-fold>
|
||||||
|
|
||||||
//<editor-fold defaultstate="collapsed" desc="AppendToResponse Getters">
|
//<editor-fold defaultstate="collapsed" desc="AppendToResponse Getters">
|
||||||
@@ -325,6 +296,12 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
|||||||
addMethod(MovieMethod.LISTS);
|
addMethod(MovieMethod.LISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonSetter("recommendations")
|
||||||
|
public void seRecommendations(WrapperGenericList<MovieInfo> recommendations) {
|
||||||
|
this.recommendations = recommendations.getResults();
|
||||||
|
addMethod(MovieMethod.RECOMMENDATIONS);
|
||||||
|
}
|
||||||
|
|
||||||
@JsonSetter("reviews")
|
@JsonSetter("reviews")
|
||||||
public void setReviews(WrapperGenericList<Review> reviews) {
|
public void setReviews(WrapperGenericList<Review> reviews) {
|
||||||
this.reviews = reviews.getResults();
|
this.reviews = reviews.getResults();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.omertron.themoviedbapi.model.movie;
|
package com.omertron.themoviedbapi.model.movie;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||||
import com.omertron.themoviedbapi.model.AbstractIdName;
|
import com.omertron.themoviedbapi.model.AbstractIdName;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -29,6 +30,26 @@ import java.io.Serializable;
|
|||||||
@JsonRootName("production_company")
|
@JsonRootName("production_company")
|
||||||
public class ProductionCompany extends AbstractIdName implements Serializable {
|
public class ProductionCompany extends AbstractIdName implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
// Nothing to override from the base class.
|
@JsonProperty("logo_path")
|
||||||
|
private String logoPath;
|
||||||
|
@JsonProperty("origin_country")
|
||||||
|
private String originCountry;
|
||||||
|
|
||||||
|
public String getLogoPath() {
|
||||||
|
return logoPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLogoPath(String logoPath) {
|
||||||
|
this.logoPath = logoPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginCountry() {
|
||||||
|
return originCountry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginCountry(String originCountry) {
|
||||||
|
this.originCountry = originCountry;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 Stuart Boston
|
* Copyright (c) 2004-2016 Stuart Boston
|
||||||
*
|
*
|
||||||
* This file is part of TheMovieDB API.
|
* This file is part of TheMovieDB API.
|
||||||
*
|
*
|
||||||
@@ -32,7 +32,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
|||||||
@JsonRootName("production_country")
|
@JsonRootName("production_country")
|
||||||
public class ProductionCountry extends AbstractJsonMapping implements Serializable {
|
public class ProductionCountry extends AbstractJsonMapping implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4L;
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
@JsonProperty("iso_3166_1")
|
@JsonProperty("iso_3166_1")
|
||||||
private String country;
|
private String country;
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.omertron.themoviedbapi.model.movie;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||||
|
|
||||||
|
public class Release extends AbstractJsonMapping {
|
||||||
|
|
||||||
|
@JsonProperty("certification")
|
||||||
|
private String certification;
|
||||||
|
@JsonProperty("release_date")
|
||||||
|
private String releaseDate;
|
||||||
|
|
||||||
|
public String getCertification() {
|
||||||
|
return certification;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCertification(String certification) {
|
||||||
|
this.certification = certification;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReleaseDate() {
|
||||||
|
return releaseDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReleaseDate(String releaseDate) {
|
||||||
|
this.releaseDate = releaseDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2016 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.movie;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||||
|
import com.omertron.themoviedbapi.enumeration.ReleaseType;
|
||||||
|
|
||||||
|
public class ReleaseDate extends Release {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 100L;
|
||||||
|
|
||||||
|
@JsonProperty("note")
|
||||||
|
private String note;
|
||||||
|
@JsonProperty("iso_639_1")
|
||||||
|
private String language;
|
||||||
|
private ReleaseType releaseType;
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNote(String note) {
|
||||||
|
this.note = note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLanguage() {
|
||||||
|
return language;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLanguage(String language) {
|
||||||
|
this.language = language;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReleaseType getType() {
|
||||||
|
return releaseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonSetter("type")
|
||||||
|
public void setType(int type) {
|
||||||
|
this.releaseType = ReleaseType.fromInteger(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user