Compare commits
74 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 |
+4
-1
@@ -11,4 +11,7 @@ testing.properties
|
||||
.settings
|
||||
.classpath
|
||||
.project
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
/nbproject/
|
||||
.idea
|
||||
*.iml
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<groupId>com.omertron</groupId>
|
||||
<artifactId>themoviedbapi</artifactId>
|
||||
<version>4.1</version>
|
||||
<version>4.4-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>API-The MovieDB</name>
|
||||
@@ -71,12 +71,14 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<distribution.format>zip</distribution.format>
|
||||
<version.jackson>2.6.3</version.jackson>
|
||||
<version.slf4j>1.7.12</version.slf4j>
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
<version.jackson>2.10.0</version.jackson>
|
||||
<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>
|
||||
|
||||
<dependencies>
|
||||
@@ -84,7 +86,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<version>4.13.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!--JSON-->
|
||||
@@ -119,23 +121,32 @@
|
||||
<dependency>
|
||||
<groupId>org.yamj</groupId>
|
||||
<artifactId>api-common</artifactId>
|
||||
<version>2.0</version>
|
||||
<version>2.1</version>
|
||||
</dependency>
|
||||
<!-- Apache Utils -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.4</version>
|
||||
<version>2.6</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>disable-java8-doclint</id>
|
||||
<activation>
|
||||
<jdk>[1.8,)</jdk>
|
||||
</activation>
|
||||
<properties>
|
||||
<additionalparam>-Xdoclint:none</additionalparam>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>release-sign-artifacts</id>
|
||||
<activation>
|
||||
@@ -181,7 +192,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -191,7 +202,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.3</version>
|
||||
<version>3.7.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -211,27 +222,27 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<version>3.0.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
<version>3.0.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.4</version>
|
||||
<version>3.7</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.18.1</version>
|
||||
<version>2.21.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>pl.project13.maven</groupId>
|
||||
<artifactId>git-commit-id-plugin</artifactId>
|
||||
<version>2.2.0</version>
|
||||
<version>2.2.4</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
@@ -343,12 +354,12 @@
|
||||
<extension>
|
||||
<groupId>org.apache.maven.scm</groupId>
|
||||
<artifactId>maven-scm-provider-gitexe</artifactId>
|
||||
<version>1.9.4</version>
|
||||
<version>1.9.5</version>
|
||||
</extension>
|
||||
<extension>
|
||||
<groupId>org.apache.maven.scm</groupId>
|
||||
<artifactId>maven-scm-manager-plexus</artifactId>
|
||||
<version>1.9.4</version>
|
||||
<version>1.9.5</version>
|
||||
</extension>
|
||||
<extension>
|
||||
<groupId>org.kathrynhuxtable.maven.wagon</groupId>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -33,7 +33,7 @@ public class AppendToResponseBuilder {
|
||||
/**
|
||||
* Construct the builder with the first method
|
||||
*
|
||||
* @param method
|
||||
* @param method method
|
||||
*/
|
||||
public AppendToResponseBuilder(AppendToResponseMethod method) {
|
||||
response = new StringBuilder(method.getPropertyString());
|
||||
@@ -42,7 +42,7 @@ public class AppendToResponseBuilder {
|
||||
/**
|
||||
* Generate the string
|
||||
*
|
||||
* @return
|
||||
* @return ATR string
|
||||
*/
|
||||
public String build() {
|
||||
return response.toString();
|
||||
@@ -51,8 +51,8 @@ public class AppendToResponseBuilder {
|
||||
/**
|
||||
* Add a method to the list
|
||||
*
|
||||
* @param method
|
||||
* @return
|
||||
* @param method method
|
||||
* @return builder
|
||||
*/
|
||||
public AppendToResponseBuilder add(AppendToResponseMethod method) {
|
||||
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.
|
||||
*
|
||||
@@ -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 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 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 title
|
||||
* @param year
|
||||
* @param maxDistance
|
||||
* @return
|
||||
* @param moviedb movieinfo
|
||||
* @param title title
|
||||
* @param year year
|
||||
* @param maxDistance maximum distance
|
||||
* @return true if matched
|
||||
*/
|
||||
public static boolean movies(final MovieInfo moviedb, final String title, final String year, int maxDistance) {
|
||||
return Compare.movies(moviedb, title, year, maxDistance, true);
|
||||
@@ -122,9 +122,9 @@ public class Compare {
|
||||
/**
|
||||
* Compare the Levenshtein Distance between the two strings
|
||||
*
|
||||
* @param title1
|
||||
* @param title2
|
||||
* @param distance
|
||||
* @param title1 title
|
||||
* @param title2 title
|
||||
* @param distance max distance
|
||||
*/
|
||||
private static boolean compareDistance(final String title1, final String title2, int distance) {
|
||||
return StringUtils.getLevenshteinDistance(title1, title2) <= distance;
|
||||
@@ -133,7 +133,7 @@ public class Compare {
|
||||
/**
|
||||
* Check the year is not blank or UNKNOWN
|
||||
*
|
||||
* @param year
|
||||
* @param year year
|
||||
*/
|
||||
private static boolean isValidYear(final String 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.
|
||||
*
|
||||
|
||||
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.
|
||||
*
|
||||
@@ -46,8 +46,8 @@ public enum ArtworkType {
|
||||
/**
|
||||
* Convert a string into an Enum type
|
||||
*
|
||||
* @param artworkType
|
||||
* @return
|
||||
* @param artworkType String to convert to enum
|
||||
* @return enum version of param
|
||||
* @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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -36,6 +36,10 @@ public enum MediaType {
|
||||
* TV Show media type
|
||||
*/
|
||||
TV,
|
||||
/**
|
||||
* TV Season media type
|
||||
*/
|
||||
SEASON,
|
||||
/**
|
||||
* TV Episode media type
|
||||
*/
|
||||
@@ -44,8 +48,8 @@ public enum MediaType {
|
||||
/**
|
||||
* Convert a string into an Enum type
|
||||
*
|
||||
* @param mediaType
|
||||
* @return
|
||||
* @param mediaType String to convert to enum
|
||||
* @return enum version of param
|
||||
* @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.
|
||||
*
|
||||
@@ -35,6 +35,7 @@ public enum MovieMethod implements AppendToResponseMethod {
|
||||
IMAGES,
|
||||
KEYWORDS,
|
||||
LISTS,
|
||||
RECOMMENDATIONS,
|
||||
RELEASES,
|
||||
REVIEWS,
|
||||
SIMILAR,
|
||||
@@ -44,7 +45,7 @@ public enum MovieMethod implements AppendToResponseMethod {
|
||||
/**
|
||||
* Get the string to use in the URL
|
||||
*
|
||||
* @return
|
||||
* @return the string representation of the enum
|
||||
*/
|
||||
@Override
|
||||
public String getPropertyString() {
|
||||
@@ -54,8 +55,8 @@ public enum MovieMethod implements AppendToResponseMethod {
|
||||
/**
|
||||
* Convert a string into an Enum type
|
||||
*
|
||||
* @param method
|
||||
* @return
|
||||
* @param method String to convert to enum
|
||||
* @return enum version of param
|
||||
* @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.
|
||||
*
|
||||
@@ -40,7 +40,7 @@ public enum PeopleMethod implements AppendToResponseMethod {
|
||||
/**
|
||||
* Get the string to use in the URL
|
||||
*
|
||||
* @return
|
||||
* @return the string representation of the enum
|
||||
*/
|
||||
@Override
|
||||
public String getPropertyString() {
|
||||
@@ -50,8 +50,8 @@ public enum PeopleMethod implements AppendToResponseMethod {
|
||||
/**
|
||||
* Convert a string into an Enum type
|
||||
*
|
||||
* @param method
|
||||
* @return
|
||||
* @param method String to convert to enum
|
||||
* @return enum version of param
|
||||
* @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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -37,7 +37,7 @@ public enum TVEpisodeMethod implements AppendToResponseMethod {
|
||||
/**
|
||||
* Get the string to use in the URL
|
||||
*
|
||||
* @return
|
||||
* @return the string representation of the enum
|
||||
*/
|
||||
@Override
|
||||
public String getPropertyString() {
|
||||
@@ -47,8 +47,8 @@ public enum TVEpisodeMethod implements AppendToResponseMethod {
|
||||
/**
|
||||
* Convert a string into an Enum type
|
||||
*
|
||||
* @param method
|
||||
* @return
|
||||
* @param method String to convert to enum
|
||||
* @return enum version of param
|
||||
* @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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.movie.MovieBasic;
|
||||
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.PersonInfo;
|
||||
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.WrapperGenericList;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -67,7 +69,7 @@ public class AbstractMethod {
|
||||
protected final HttpTools httpTools;
|
||||
// Jackson JSON configuration
|
||||
protected static final ObjectMapper MAPPER = new ObjectMapper();
|
||||
private static final Map<Class, TypeReference> TYPE_REFS = new HashMap<>();
|
||||
private static final Map<Class<? extends Serializable>, TypeReference<? extends WrapperGenericList<? extends Serializable>>> TYPE_REFS = new HashMap<>();
|
||||
|
||||
static {
|
||||
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(ReleaseDates.class, new TypeReference<WrapperGenericList<ReleaseDates>>() {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -121,9 +125,9 @@ public class AbstractMethod {
|
||||
* @return
|
||||
* @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)) {
|
||||
return TYPE_REFS.get(aClass);
|
||||
return (TypeReference<? extends WrapperGenericList<T>>) TYPE_REFS.get(aClass);
|
||||
} else {
|
||||
throw new MovieDbException(ApiExceptionType.UNKNOWN_CAUSE, "Class type reference for '" + aClass.getSimpleName() + "' not found!");
|
||||
}
|
||||
@@ -139,7 +143,7 @@ public class AbstractMethod {
|
||||
* @return
|
||||
* @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);
|
||||
return val.getResults();
|
||||
}
|
||||
@@ -154,7 +158,7 @@ public class AbstractMethod {
|
||||
* @return
|
||||
* @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);
|
||||
try {
|
||||
// Due to type erasure, this doesn't work
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -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.
|
||||
*
|
||||
* 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
|
||||
* @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.
|
||||
*
|
||||
@@ -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.
|
||||
*
|
||||
@@ -136,14 +141,18 @@ public class TmdbAuthentication extends AbstractMethod {
|
||||
/**
|
||||
* 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
|
||||
* account in the future.
|
||||
* 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 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
|
||||
* @throws MovieDbException
|
||||
@@ -157,4 +166,5 @@ public class TmdbAuthentication extends AbstractMethod {
|
||||
} catch (IOException 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -32,6 +32,7 @@ import com.omertron.themoviedbapi.model.media.MediaState;
|
||||
import com.omertron.themoviedbapi.model.media.Translation;
|
||||
import com.omertron.themoviedbapi.model.media.Video;
|
||||
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.review.Review;
|
||||
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.
|
||||
*
|
||||
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies
|
||||
* found.
|
||||
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies found.
|
||||
*
|
||||
* @param movieId
|
||||
* @param language
|
||||
@@ -111,8 +111,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
*
|
||||
* It will return the single highest rated poster and backdrop.
|
||||
*
|
||||
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies
|
||||
* found.
|
||||
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies found.
|
||||
*
|
||||
* @param imdbId
|
||||
* @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
|
||||
* been rated or added to their favourite or movie watch list.
|
||||
* 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
|
||||
* list.
|
||||
*
|
||||
* 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
|
||||
* a particular movie.
|
||||
* This method is used to retrieve all of the alternative titles we have for a particular movie.
|
||||
*
|
||||
* @param movieId
|
||||
* @param country
|
||||
@@ -213,8 +211,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method should be used when you’re wanting to retrieve all of the
|
||||
* images for a particular movie.
|
||||
* This method should be used when you’re wanting to retrieve all of the images for a particular movie.
|
||||
*
|
||||
* @param movieId
|
||||
* @param language
|
||||
@@ -240,8 +237,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to retrieve all of the keywords that have been added
|
||||
* to a particular movie.
|
||||
* This method is used to retrieve all of the keywords that have been added to a particular movie.
|
||||
*
|
||||
* Currently, only English keywords exist.
|
||||
*
|
||||
@@ -267,8 +263,25 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to retrieve all of the release and certification data
|
||||
* we have for a specific movie.
|
||||
* The recommendations method will let you retrieve the movie recommendations for a particular 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 language
|
||||
@@ -294,8 +307,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to retrieve all of the trailers for a particular
|
||||
* movie.
|
||||
* This method is used to retrieve all of the trailers for a particular movie.
|
||||
*
|
||||
* Supported sites are YouTube and QuickTime.
|
||||
*
|
||||
@@ -323,8 +335,25 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to retrieve a list of the available translations for
|
||||
* a specific movie.
|
||||
* Get the release dates, certifications and related information by country for a specific movie id.
|
||||
*
|
||||
* 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
|
||||
* @return
|
||||
@@ -348,11 +377,9 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* The similar movies method will let you retrieve the similar movies for a
|
||||
* particular movie.
|
||||
* The similar movies method will let you retrieve the similar movies for a particular movie.
|
||||
*
|
||||
* This data is created dynamically but with the help of users votes on
|
||||
* TMDb.
|
||||
* This data is created dynamically but with the help of users votes on TMDb.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The maximum number of days that can be returned in a single request is
|
||||
* 14.
|
||||
* The maximum number of days that can be returned in a single request is 14.
|
||||
*
|
||||
* 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 is a curated list that will normally contain 100 movies. The default
|
||||
* response will return 20 movies.
|
||||
* This is a curated list that will normally contain 100 movies. The default response will return 20 movies.
|
||||
*
|
||||
* @param language
|
||||
* @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
|
||||
* votes on TMDb.
|
||||
* This method is used to retrieve the top rated movies that have over 10 votes on TMDb.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -113,7 +113,7 @@ public class TmdbPeople extends AbstractMethod {
|
||||
String webpage = httpTools.getRequest(url);
|
||||
|
||||
try {
|
||||
TypeReference tr = new TypeReference<PersonCreditList<CreditMovieBasic>>() {
|
||||
TypeReference<PersonCreditList<CreditMovieBasic>> tr = new TypeReference<PersonCreditList<CreditMovieBasic>>() {
|
||||
};
|
||||
return MAPPER.readValue(webpage, tr);
|
||||
} catch (IOException ex) {
|
||||
@@ -144,7 +144,7 @@ public class TmdbPeople extends AbstractMethod {
|
||||
String webpage = httpTools.getRequest(url);
|
||||
|
||||
try {
|
||||
TypeReference tr = new TypeReference<PersonCreditList<CreditTVBasic>>() {
|
||||
TypeReference<PersonCreditList<CreditTVBasic>> tr = new TypeReference<PersonCreditList<CreditTVBasic>>() {
|
||||
};
|
||||
return MAPPER.readValue(webpage, tr);
|
||||
} catch (IOException ex) {
|
||||
@@ -177,7 +177,7 @@ public class TmdbPeople extends AbstractMethod {
|
||||
try {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
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);
|
||||
} 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.company.Company;
|
||||
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.movie.MovieInfo;
|
||||
import com.omertron.themoviedbapi.model.person.PersonFind;
|
||||
@@ -121,26 +120,6 @@ public class TmdbSearch extends AbstractMethod {
|
||||
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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -32,7 +32,6 @@ import com.omertron.themoviedbapi.model.media.Translation;
|
||||
import com.omertron.themoviedbapi.model.media.Video;
|
||||
import com.omertron.themoviedbapi.model.person.ContentRating;
|
||||
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.results.ResultList;
|
||||
import com.omertron.themoviedbapi.results.WrapperGenericList;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -45,8 +45,8 @@ public abstract class AbstractJsonMapping implements Serializable {
|
||||
@JsonAnySetter
|
||||
protected void handleUnknown(String key, Object value) {
|
||||
StringBuilder unknown = new StringBuilder(this.getClass().getSimpleName());
|
||||
unknown.append(": Unknown property='").append(key);
|
||||
unknown.append("' value='").append(value).append("'");
|
||||
unknown.append(": Unknown property='").append(key)
|
||||
.append("' value='").append(value).append("'");
|
||||
|
||||
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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -34,20 +34,20 @@ public class Language extends AbstractJsonMapping implements Serializable {
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("iso_639_1")
|
||||
private String isoCode;
|
||||
private String code;
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
public String getIsoCode() {
|
||||
return isoCode;
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setIsoCode(String isoCode) {
|
||||
this.isoCode = isoCode;
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
@@ -59,7 +59,7 @@ public class Language extends AbstractJsonMapping implements Serializable {
|
||||
if (obj instanceof Language) {
|
||||
final Language other = (Language) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(isoCode, other.isoCode)
|
||||
.append(code, other.code)
|
||||
.append(name, other.name)
|
||||
.isEquals();
|
||||
} else {
|
||||
@@ -70,7 +70,7 @@ public class Language extends AbstractJsonMapping implements Serializable {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder()
|
||||
.append(isoCode)
|
||||
.append(code)
|
||||
.append(name)
|
||||
.toHashCode();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.omertron.themoviedbapi.interfaces.Identification;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
@@ -48,6 +49,24 @@ public class Collection extends AbstractJsonMapping implements Serializable, Ide
|
||||
private String backdropPath;
|
||||
@JsonProperty("release_date")
|
||||
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() {
|
||||
return backdropPath;
|
||||
@@ -80,6 +99,18 @@ public class Collection extends AbstractJsonMapping implements Serializable, Ide
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<Integer> getGenreIds() {
|
||||
return genreIds;
|
||||
}
|
||||
|
||||
public boolean isAdult() {
|
||||
return adult;
|
||||
}
|
||||
|
||||
public String getOriginalLanguage() {
|
||||
return originalLanguage;
|
||||
}
|
||||
|
||||
public void setBackdropPath(String backdropPath) {
|
||||
this.backdropPath = backdropPath;
|
||||
}
|
||||
@@ -105,6 +136,66 @@ public class Collection extends AbstractJsonMapping implements Serializable, Ide
|
||||
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
|
||||
public boolean equals(Object obj) {
|
||||
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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -48,6 +48,8 @@ public class Company extends AbstractJsonMapping implements Serializable, Identi
|
||||
private String logoPath = EMPTY;
|
||||
@JsonProperty("parent_company")
|
||||
private Company parentCompany = null;
|
||||
@JsonProperty("origin_country")
|
||||
private String originCountry;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
@@ -114,4 +116,13 @@ public class Company extends AbstractJsonMapping implements Serializable, Identi
|
||||
parent.setLogoPath(logoPath);
|
||||
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.
|
||||
*
|
||||
@@ -199,8 +199,7 @@ public class Configuration extends AbstractJsonMapping implements Serializable {
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder(getBaseUrl());
|
||||
sb.append(requiredSize);
|
||||
sb.append(imagePath);
|
||||
sb.append(requiredSize).append(imagePath);
|
||||
|
||||
try {
|
||||
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.
|
||||
*
|
||||
@@ -30,7 +30,7 @@ public class JobDepartment extends AbstractJsonMapping implements Serializable {
|
||||
// Properties
|
||||
@JsonProperty("department")
|
||||
private String department;
|
||||
@JsonProperty("job_list")
|
||||
@JsonProperty("jobs")
|
||||
private List<String> jobs;
|
||||
|
||||
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.
|
||||
*
|
||||
@@ -27,6 +27,7 @@ import com.omertron.themoviedbapi.enumeration.MediaType;
|
||||
import com.omertron.themoviedbapi.interfaces.Identification;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author stuart.boston
|
||||
@@ -44,6 +45,20 @@ public class CreditBasic extends AbstractJsonMapping implements Serializable, Id
|
||||
private int id;
|
||||
@JsonProperty("poster_path")
|
||||
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
|
||||
@JsonProperty("character")
|
||||
@@ -71,7 +86,7 @@ public class CreditBasic extends AbstractJsonMapping implements Serializable, Id
|
||||
this.mediaType = MediaType.fromString(mediaType);
|
||||
}
|
||||
|
||||
public void setMediaType(MediaType mediaType) {
|
||||
public final void setMediaType(MediaType mediaType) {
|
||||
this.mediaType = mediaType;
|
||||
}
|
||||
|
||||
@@ -128,4 +143,60 @@ public class CreditBasic extends AbstractJsonMapping implements Serializable, Id
|
||||
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.
|
||||
*
|
||||
@@ -38,6 +38,8 @@ public class CreditMovieBasic extends CreditBasic implements Serializable {
|
||||
private String releaseDate;
|
||||
@JsonProperty("title")
|
||||
private String title;
|
||||
@JsonProperty("video")
|
||||
private boolean video;
|
||||
|
||||
public CreditMovieBasic() {
|
||||
setMediaType(MediaType.MOVIE);
|
||||
@@ -75,4 +77,12 @@ public class CreditMovieBasic extends CreditBasic implements Serializable {
|
||||
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.
|
||||
*
|
||||
@@ -38,6 +38,8 @@ public class CreditTVBasic extends CreditBasic implements Serializable {
|
||||
private String name;
|
||||
@JsonProperty("original_name")
|
||||
private String originalName;
|
||||
@JsonProperty("origin_country")
|
||||
private String originCountry;
|
||||
|
||||
public CreditTVBasic() {
|
||||
setMediaType(MediaType.TV);
|
||||
@@ -75,4 +77,12 @@ public class CreditTVBasic extends CreditBasic implements Serializable {
|
||||
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.
|
||||
*
|
||||
@@ -40,6 +40,8 @@ public class MediaCredit extends AbstractJsonMapping implements Serializable, Id
|
||||
private String artworkPath;
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
@JsonProperty("gender")
|
||||
private int gender;
|
||||
|
||||
public String getCreditId() {
|
||||
return creditId;
|
||||
@@ -75,4 +77,12 @@ public class MediaCredit extends AbstractJsonMapping implements Serializable, Id
|
||||
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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -25,7 +25,7 @@ import com.omertron.themoviedbapi.tools.TmdbParameters;
|
||||
|
||||
/**
|
||||
* Generate a discover object for use in the MovieDbApi
|
||||
* <p/>
|
||||
* <p>
|
||||
* This allows you to just add the search components you are concerned with
|
||||
*
|
||||
* @author stuart.boston
|
||||
@@ -39,7 +39,7 @@ public class Discover {
|
||||
|
||||
/**
|
||||
* Get the parameters
|
||||
* <p/>
|
||||
* <p>
|
||||
* This will be used to construct the URL in the API
|
||||
*
|
||||
* @return
|
||||
@@ -137,6 +137,33 @@ public class Discover {
|
||||
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
|
||||
*
|
||||
@@ -183,7 +210,7 @@ public class Discover {
|
||||
|
||||
/**
|
||||
* The minimum release to include.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Expected format is YYYY-MM-DD.
|
||||
*
|
||||
* @param releaseDateGte
|
||||
@@ -196,7 +223,7 @@ public class Discover {
|
||||
|
||||
/**
|
||||
* The maximum release to include.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Expected format is YYYY-MM-DD.
|
||||
*
|
||||
* @param releaseDateLte
|
||||
@@ -209,9 +236,9 @@ public class Discover {
|
||||
|
||||
/**
|
||||
* Only include movies with certifications for a specific country.
|
||||
* <p/>
|
||||
* <p>
|
||||
* When this value is specified, 'certificationLte' is required.
|
||||
* <p/>
|
||||
* <p>
|
||||
* A ISO 3166-1 is expected
|
||||
*
|
||||
* @param certificationCountry
|
||||
@@ -224,7 +251,7 @@ public class Discover {
|
||||
|
||||
/**
|
||||
* Only include movies with this certification and lower.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Expected value is a valid certification for the specified 'certificationCountry'.
|
||||
*
|
||||
* @param certificationLte
|
||||
@@ -337,11 +364,11 @@ public class Discover {
|
||||
|
||||
/**
|
||||
* Only include movies with the specified genres.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Expected value is an integer (the id of a genre).
|
||||
* <p/>
|
||||
* <p>
|
||||
* Multiple values can be specified.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Comma separated indicates an 'AND' query, while a pipe (|) separated value indicates an 'OR'
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -26,6 +26,8 @@ public class ListStatusCode extends StatusCode {
|
||||
|
||||
@JsonProperty("list_id")
|
||||
private String listId;
|
||||
@JsonProperty("success")
|
||||
private boolean success;
|
||||
|
||||
public String getListId() {
|
||||
return listId;
|
||||
@@ -34,4 +36,13 @@ public class ListStatusCode extends StatusCode {
|
||||
public void setListId(String 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -35,6 +35,8 @@ public class AlternativeTitle implements Serializable {
|
||||
private String country;
|
||||
@JsonProperty("title")
|
||||
private String title;
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
@@ -52,6 +54,14 @@ public class AlternativeTitle implements Serializable {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof AlternativeTitle) {
|
||||
@@ -59,6 +69,7 @@ public class AlternativeTitle implements Serializable {
|
||||
return new EqualsBuilder()
|
||||
.append(country, other.country)
|
||||
.append(title, other.title)
|
||||
.append(type, other.type)
|
||||
.isEquals();
|
||||
} else {
|
||||
return false;
|
||||
@@ -70,6 +81,7 @@ public class AlternativeTitle implements Serializable {
|
||||
return new HashCodeBuilder()
|
||||
.append(country)
|
||||
.append(title)
|
||||
.append(type)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -37,34 +37,44 @@ public class Translation extends AbstractJsonMapping implements Serializable {
|
||||
@JsonProperty("english_name")
|
||||
private String englishName;
|
||||
@JsonProperty("iso_639_1")
|
||||
private String isoCode;
|
||||
private String language;
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
@JsonProperty("iso_3166_1")
|
||||
private String country;
|
||||
|
||||
public String getEnglishName() {
|
||||
return englishName;
|
||||
}
|
||||
|
||||
public String getIsoCode() {
|
||||
return isoCode;
|
||||
public String getLanguage() {
|
||||
return language;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setEnglishName(String englishName) {
|
||||
this.englishName = englishName;
|
||||
}
|
||||
|
||||
public void setIsoCode(String isoCode) {
|
||||
this.isoCode = isoCode;
|
||||
public void setLanguage(String language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Translation) {
|
||||
@@ -72,7 +82,7 @@ public class Translation extends AbstractJsonMapping implements Serializable {
|
||||
return new EqualsBuilder()
|
||||
.append(name, other.name)
|
||||
.append(englishName, other.englishName)
|
||||
.append(isoCode, other.isoCode)
|
||||
.append(language, other.language)
|
||||
.isEquals();
|
||||
} else {
|
||||
return false;
|
||||
@@ -83,7 +93,7 @@ public class Translation extends AbstractJsonMapping implements Serializable {
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder()
|
||||
.append(englishName)
|
||||
.append(isoCode)
|
||||
.append(language)
|
||||
.append(name)
|
||||
.toHashCode();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -36,8 +36,6 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
@JsonProperty("iso_639_1")
|
||||
private String language;
|
||||
@JsonProperty("key")
|
||||
private String key;
|
||||
@JsonProperty("name")
|
||||
@@ -48,6 +46,10 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
||||
private int size;
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
@JsonProperty("iso_639_1")
|
||||
private String language;
|
||||
@JsonProperty("iso_3166_1")
|
||||
private String country;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
@@ -77,6 +79,10 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
||||
return language;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
@@ -105,6 +111,10 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Video) {
|
||||
@@ -115,6 +125,7 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
||||
.append(size, other.size)
|
||||
.append(key, other.key)
|
||||
.append(language, other.language)
|
||||
.append(country, other.country)
|
||||
.isEquals();
|
||||
} else {
|
||||
return false;
|
||||
@@ -130,6 +141,7 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
||||
.append(key)
|
||||
.append(site)
|
||||
.append(language)
|
||||
.append(country)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -94,6 +94,7 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
||||
private List<Video> videos = Collections.emptyList();
|
||||
private List<Translation> translations = Collections.emptyList();
|
||||
private List<MovieInfo> similarMovies = Collections.emptyList();
|
||||
private List<MovieInfo> recommendations = Collections.emptyList();
|
||||
private List<Review> reviews = Collections.emptyList();
|
||||
private List<UserList> lists = Collections.emptyList();
|
||||
private List<ChangeKeyItem> changes = Collections.emptyList();
|
||||
@@ -295,6 +296,12 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
||||
addMethod(MovieMethod.LISTS);
|
||||
}
|
||||
|
||||
@JsonSetter("recommendations")
|
||||
public void seRecommendations(WrapperGenericList<MovieInfo> recommendations) {
|
||||
this.recommendations = recommendations.getResults();
|
||||
addMethod(MovieMethod.RECOMMENDATIONS);
|
||||
}
|
||||
|
||||
@JsonSetter("reviews")
|
||||
public void setReviews(WrapperGenericList<Review> reviews) {
|
||||
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.
|
||||
*
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
package com.omertron.themoviedbapi.model.movie;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.omertron.themoviedbapi.model.AbstractIdName;
|
||||
import java.io.Serializable;
|
||||
@@ -30,5 +31,25 @@ import java.io.Serializable;
|
||||
public class ProductionCompany extends AbstractIdName implements Serializable {
|
||||
|
||||
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.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.omertron.themoviedbapi.model.movie;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import java.util.List;
|
||||
|
||||
public class ReleaseDates extends AbstractJsonMapping {
|
||||
|
||||
@JsonProperty("iso_3166_1")
|
||||
private String country;
|
||||
@JsonProperty("release_dates")
|
||||
private List<ReleaseDate> releaseDate;
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public List<ReleaseDate> getReleaseDate() {
|
||||
return releaseDate;
|
||||
}
|
||||
|
||||
public void setReleaseDate(List<ReleaseDate> releaseDate) {
|
||||
this.releaseDate = releaseDate;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -19,7 +19,6 @@
|
||||
*/
|
||||
package com.omertron.themoviedbapi.model.movie;
|
||||
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
@@ -28,43 +27,23 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
/**
|
||||
* @author Stuart
|
||||
*/
|
||||
public class ReleaseInfo extends AbstractJsonMapping implements Serializable {
|
||||
public class ReleaseInfo extends Release implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("iso_3166_1")
|
||||
private String country;
|
||||
@JsonProperty("certification")
|
||||
private String certification;
|
||||
@JsonProperty("release_date")
|
||||
private String releaseDate;
|
||||
@JsonProperty("primary")
|
||||
private boolean primary;
|
||||
|
||||
public String getCertification() {
|
||||
return certification;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public String getReleaseDate() {
|
||||
return releaseDate;
|
||||
}
|
||||
|
||||
public void setCertification(String certification) {
|
||||
this.certification = certification;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public void setReleaseDate(String releaseDate) {
|
||||
this.releaseDate = releaseDate;
|
||||
}
|
||||
|
||||
public boolean isPrimary() {
|
||||
return primary;
|
||||
}
|
||||
@@ -78,9 +57,9 @@ public class ReleaseInfo extends AbstractJsonMapping implements Serializable {
|
||||
if (obj instanceof ReleaseInfo) {
|
||||
final ReleaseInfo other = (ReleaseInfo) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(country, other.country)
|
||||
.append(certification, other.certification)
|
||||
.append(releaseDate, other.releaseDate)
|
||||
.append(getCountry(), other.getCountry())
|
||||
.append(getCertification(), other.getCertification())
|
||||
.append(getReleaseDate(), other.getReleaseDate())
|
||||
.append(primary, other.primary)
|
||||
.isEquals();
|
||||
} else {
|
||||
@@ -91,9 +70,9 @@ public class ReleaseInfo extends AbstractJsonMapping implements Serializable {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder()
|
||||
.append(country)
|
||||
.append(certification)
|
||||
.append(releaseDate)
|
||||
.append(getCountry())
|
||||
.append(getCertification())
|
||||
.append(getReleaseDate())
|
||||
.append(primary)
|
||||
.toHashCode();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
package com.omertron.themoviedbapi.model.network;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.interfaces.Identification;
|
||||
import com.omertron.themoviedbapi.model.AbstractIdName;
|
||||
import java.io.Serializable;
|
||||
@@ -30,5 +31,45 @@ public class Network extends AbstractIdName implements Serializable, Identificat
|
||||
|
||||
private static final long serialVersionUID = 100L;
|
||||
// Nothing to add to base class
|
||||
@JsonProperty("headquarters")
|
||||
private String headquarters;
|
||||
@JsonProperty("homepage")
|
||||
private String homepage;
|
||||
@JsonProperty("origin_country")
|
||||
private String originCountry;
|
||||
@JsonProperty("logo_path")
|
||||
private String logoPath;
|
||||
|
||||
public String getHeadquarters() {
|
||||
return headquarters;
|
||||
}
|
||||
|
||||
public void setHeadquarters(String headquarters) {
|
||||
this.headquarters = headquarters;
|
||||
}
|
||||
|
||||
public String getHomepage() {
|
||||
return homepage;
|
||||
}
|
||||
|
||||
public void setHomepage(String homepage) {
|
||||
this.homepage = homepage;
|
||||
}
|
||||
|
||||
public String getOriginCountry() {
|
||||
return originCountry;
|
||||
}
|
||||
|
||||
public void setOriginCountry(String originCountry) {
|
||||
this.originCountry = originCountry;
|
||||
}
|
||||
|
||||
public String getLogoPath() {
|
||||
return logoPath;
|
||||
}
|
||||
|
||||
public void setLogoPath(String logoPath) {
|
||||
this.logoPath = logoPath;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user