├── .gitattributes ├── .gitignore ├── JacksonReplacement ├── JsonAnySetter.java ├── JsonProperty.java ├── JsonRootName.java ├── ObjectMapper.java └── README.md ├── LICENCE.txt ├── README.md ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── omertron │ │ └── themoviedbapi │ │ ├── AppendToResponseBuilder.java │ │ ├── Compare.java │ │ ├── MovieDbException.java │ │ ├── TheMovieDbApi.java │ │ ├── enumeration │ │ ├── ArtworkType.java │ │ ├── CreditType.java │ │ ├── ExternalSource.java │ │ ├── Gender.java │ │ ├── MediaType.java │ │ ├── MovieMethod.java │ │ ├── PeopleMethod.java │ │ ├── ReleaseType.java │ │ ├── SearchType.java │ │ ├── SortBy.java │ │ ├── TVEpisodeMethod.java │ │ ├── TVMethod.java │ │ └── TVSeasonMethod.java │ │ ├── interfaces │ │ ├── AppendToResponse.java │ │ ├── AppendToResponseMethod.java │ │ ├── Identification.java │ │ ├── WrapperDates.java │ │ └── WrapperPages.java │ │ ├── methods │ │ ├── AbstractMethod.java │ │ ├── TmdbAccount.java │ │ ├── TmdbAuthentication.java │ │ ├── TmdbCertifications.java │ │ ├── TmdbChanges.java │ │ ├── TmdbCollections.java │ │ ├── TmdbCompanies.java │ │ ├── TmdbConfiguration.java │ │ ├── TmdbCredits.java │ │ ├── TmdbDiscover.java │ │ ├── TmdbEpisodes.java │ │ ├── TmdbFind.java │ │ ├── TmdbGenres.java │ │ ├── TmdbKeywords.java │ │ ├── TmdbLists.java │ │ ├── TmdbMovies.java │ │ ├── TmdbNetworks.java │ │ ├── TmdbPeople.java │ │ ├── TmdbReviews.java │ │ ├── TmdbSearch.java │ │ ├── TmdbSeasons.java │ │ └── TmdbTV.java │ │ ├── model │ │ ├── AbstractIdName.java │ │ ├── AbstractJsonMapping.java │ │ ├── Certification.java │ │ ├── FindResults.java │ │ ├── Genre.java │ │ ├── Language.java │ │ ├── StatusCode.java │ │ ├── account │ │ │ ├── Account.java │ │ │ ├── Avatar.java │ │ │ └── AvatarHash.java │ │ ├── artwork │ │ │ ├── Artwork.java │ │ │ └── ArtworkMedia.java │ │ ├── authentication │ │ │ ├── TokenAuthorisation.java │ │ │ └── TokenSession.java │ │ ├── change │ │ │ ├── ChangeKeyItem.java │ │ │ ├── ChangeListItem.java │ │ │ └── ChangedItem.java │ │ ├── collection │ │ │ ├── Collection.java │ │ │ └── CollectionInfo.java │ │ ├── company │ │ │ └── Company.java │ │ ├── config │ │ │ ├── Configuration.java │ │ │ └── JobDepartment.java │ │ ├── credits │ │ │ ├── CreditBasic.java │ │ │ ├── CreditMovieBasic.java │ │ │ ├── CreditTVBasic.java │ │ │ ├── MediaCredit.java │ │ │ ├── MediaCreditCast.java │ │ │ └── MediaCreditCrew.java │ │ ├── discover │ │ │ ├── Discover.java │ │ │ └── WithBuilder.java │ │ ├── keyword │ │ │ └── Keyword.java │ │ ├── list │ │ │ ├── ListItem.java │ │ │ ├── ListItemStatus.java │ │ │ ├── ListStatusCode.java │ │ │ └── UserList.java │ │ ├── media │ │ │ ├── AlternativeTitle.java │ │ │ ├── MediaBasic.java │ │ │ ├── MediaCreditList.java │ │ │ ├── MediaState.java │ │ │ ├── RatedValue.java │ │ │ ├── Trailer.java │ │ │ ├── Translation.java │ │ │ └── Video.java │ │ ├── movie │ │ │ ├── MovieBasic.java │ │ │ ├── MovieInfo.java │ │ │ ├── ProductionCompany.java │ │ │ ├── ProductionCountry.java │ │ │ ├── Release.java │ │ │ ├── ReleaseDate.java │ │ │ ├── ReleaseDates.java │ │ │ └── ReleaseInfo.java │ │ ├── network │ │ │ └── Network.java │ │ ├── person │ │ │ ├── ContentRating.java │ │ │ ├── CreditInfo.java │ │ │ ├── ExternalID.java │ │ │ ├── PersonBasic.java │ │ │ ├── PersonCreditList.java │ │ │ ├── PersonCreditsMixIn.java │ │ │ ├── PersonFind.java │ │ │ └── PersonInfo.java │ │ ├── review │ │ │ └── Review.java │ │ └── tv │ │ │ ├── TVBasic.java │ │ │ ├── TVCredit.java │ │ │ ├── TVEpisodeBasic.java │ │ │ ├── TVEpisodeInfo.java │ │ │ ├── TVInfo.java │ │ │ ├── TVSeasonBasic.java │ │ │ └── TVSeasonInfo.java │ │ ├── results │ │ ├── AbstractWrapperAll.java │ │ ├── AbstractWrapperBase.java │ │ ├── AbstractWrapperId.java │ │ ├── AbstractWrapperIdPages.java │ │ ├── ResultDates.java │ │ ├── ResultList.java │ │ ├── ResultsMap.java │ │ ├── WrapperAlternativeTitles.java │ │ ├── WrapperChanges.java │ │ ├── WrapperConfig.java │ │ ├── WrapperGenericList.java │ │ ├── WrapperGenres.java │ │ ├── WrapperImages.java │ │ ├── WrapperJobList.java │ │ ├── WrapperMovieKeywords.java │ │ ├── WrapperMultiSearch.java │ │ ├── WrapperReleaseInfo.java │ │ ├── WrapperTranslations.java │ │ └── WrapperVideos.java │ │ └── tools │ │ ├── ApiUrl.java │ │ ├── HttpTools.java │ │ ├── MethodBase.java │ │ ├── MethodSub.java │ │ ├── Param.java │ │ ├── PostBody.java │ │ ├── PostTools.java │ │ └── TmdbParameters.java └── resources │ ├── bin.xml │ └── version.txt └── test └── java └── com └── omertron └── themoviedbapi ├── AbstractTests.java ├── ArtworkResults.java ├── CompareTest.java ├── DebugTest.java ├── TestID.java ├── TestLogger.java ├── TestSuite.java ├── methods ├── TmdbAccountTest.java ├── TmdbAuthenticationTest.java ├── TmdbCertificationsTest.java ├── TmdbChangesTest.java ├── TmdbCollectionsTest.java ├── TmdbCompaniesTest.java ├── TmdbConfigurationTest.java ├── TmdbCreditsTest.java ├── TmdbDiscoverTest.java ├── TmdbEpisodesTest.java ├── TmdbFindTest.java ├── TmdbGenresTest.java ├── TmdbKeywordsTest.java ├── TmdbListsTest.java ├── TmdbMoviesTest.java ├── TmdbNetworksTest.java ├── TmdbPeopleTest.java ├── TmdbReviewsTest.java ├── TmdbSearchTest.java ├── TmdbSeasonsTest.java └── TmdbTVTest.java └── tools └── ApiUrlTest.java /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | # Package Files # 3 | *.jar 4 | *.war 5 | *.ear 6 | *.bin 7 | /target/ 8 | /nbactions.xml 9 | testing.properties 10 | *.bin 11 | .settings 12 | .classpath 13 | .project 14 | .DS_Store 15 | /nbproject/ 16 | .idea 17 | *.iml 18 | -------------------------------------------------------------------------------- /JacksonReplacement/JsonAnySetter.java: -------------------------------------------------------------------------------- 1 | package com.darylbeattie.movies.util; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target(value=ElementType.METHOD) 9 | @Retention(value=RetentionPolicy.RUNTIME) 10 | public @interface JsonAnySetter { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /JacksonReplacement/JsonProperty.java: -------------------------------------------------------------------------------- 1 | package com.darylbeattie.movies.util; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface JsonProperty { 11 | 12 | String value() default ""; 13 | } 14 | -------------------------------------------------------------------------------- /JacksonReplacement/JsonRootName.java: -------------------------------------------------------------------------------- 1 | package com.darylbeattie.movies.util; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target(ElementType.TYPE) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface JsonRootName { 11 | String value() default ""; 12 | } 13 | -------------------------------------------------------------------------------- /JacksonReplacement/ObjectMapper.java: -------------------------------------------------------------------------------- 1 | package com.darylbeattie.movies.util; 2 | 3 | import java.io.IOException; 4 | import java.lang.annotation.Annotation; 5 | import java.lang.reflect.Field; 6 | import java.lang.reflect.ParameterizedType; 7 | import java.util.List; 8 | 9 | import org.json.JSONArray; 10 | import org.json.JSONObject; 11 | 12 | public class ObjectMapper { 13 | 14 | /** 15 | * This takes a JSON string and creates (and populates) an object of the 16 | * given class with the data from that JSON string. It mimics the method 17 | * signature of the jackson JSON API, so that we don't have to import the 18 | * jackson library into this application. 19 | * 20 | * @param jsonString The JSON string to parse. 21 | * @param objClass The class of object we want to create. 22 | * @return The instantiation of that class, populated with data from the 23 | * JSON object. 24 | * @throws IOException If there was any kind of issue. 25 | */ 26 | public T readValue(String jsonString, Class objClass) throws IOException { 27 | try { 28 | return readValue(new JSONObject(jsonString), objClass); 29 | } catch (IOException ioe) { 30 | throw ioe; 31 | } catch (Exception e) { 32 | e.printStackTrace(); 33 | throw new IOException(e); 34 | } 35 | } 36 | 37 | @SuppressWarnings("unchecked") 38 | public T readValue(JSONObject json, Class objClass) throws IOException { 39 | try { 40 | //TODO Iterate through json object values and call the JsonAnySetter method on the unknown ones. 41 | T obj = objClass.newInstance(); 42 | for (Field f : objClass.getFields()) { 43 | Annotation a = f.getAnnotation(JsonProperty.class); 44 | if (List.class.equals(f.getType()) && (json.optJSONArray(((JsonProperty) a).value()) != null)) { // It's a list. 45 | JSONArray jsonArray = json.optJSONArray(((JsonProperty) a).value()); 46 | ParameterizedType listType = (ParameterizedType) f.getGenericType(); 47 | Class subObj = (Class) listType.getActualTypeArguments()[0]; 48 | List subObjList = ((Class>) f.getType()).newInstance(); 49 | for (int i = 0; i < jsonArray.length(); i++) { 50 | subObjList.add((R) readValue(jsonArray.getJSONObject(i), subObj)); 51 | } 52 | f.set(obj, subObjList); 53 | } else if (a != null) { 54 | f.set(obj, json.opt(((JsonProperty) a).value())); 55 | } 56 | } 57 | return obj; 58 | } catch (IOException ioe) { 59 | throw ioe; 60 | } catch (Exception e) { 61 | e.printStackTrace(); 62 | throw new IOException(e); 63 | } 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /JacksonReplacement/README.md: -------------------------------------------------------------------------------- 1 | Jackson Library Replacement 2 | =========================== 3 | 4 | These files are provided by Darren Beattie as an example of how to replace the Jackson libraries with native libraries inside Android. 5 | 6 | They are provided without warrantee and if you modify them or find them useful, please let me know. 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | The Movie DB API 2 | ================ 3 | 4 | Author: Stuart Boston (Omertron AT Gmail DOT com) 5 | 6 | This API uses the [TheMovieDB.org API](http://api.themoviedb.org/) 7 | 8 | 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. 9 | 10 | [![Build Status](http://jenkins.omertron.com/job/API-TheMovieDb/badge/icon)](http://jenkins.omertron.com/job/API-TheMovieDb) 11 | 12 | *** 13 | 14 | TMDB TV Support 15 | =============== 16 | 17 | Release 4.0 of the API now includes TV shows. 18 | 19 | This has resulted in a complete re-write of the API and many of the methods and models have been re-written to support the new TV calls. 20 | 21 | 22 | *** 23 | ### TheMovieDB.org 24 | This is an excellent open database for movie and film content. 25 | 26 | I *strongly* encourage you to check it out and contribute to keep it growing. 27 | 28 | ### http://www.themoviedb.org 29 | *** 30 | Project Logging 31 | --------------- 32 | This project uses [SLF4J](http://www.slf4j.org) to abstract the logging in the project. 33 | 34 | To use the logging in your own project you should add one of the bindings listed [HERE](http://www.slf4j.org/manual.html#swapping) 35 | 36 | Project Documentation 37 | --------------------- 38 | The automatically generated documentation can be found [HERE](http://omertron.github.com/api-themoviedb/) 39 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/AppendToResponseBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi; 21 | 22 | import com.omertron.themoviedbapi.interfaces.AppendToResponseMethod; 23 | 24 | /** 25 | * Simple string builder for the Append To Response methods 26 | * 27 | * @author Stuart.Boston 28 | */ 29 | public class AppendToResponseBuilder { 30 | 31 | private final StringBuilder response; 32 | 33 | /** 34 | * Construct the builder with the first method 35 | * 36 | * @param method method 37 | */ 38 | public AppendToResponseBuilder(AppendToResponseMethod method) { 39 | response = new StringBuilder(method.getPropertyString()); 40 | } 41 | 42 | /** 43 | * Generate the string 44 | * 45 | * @return ATR string 46 | */ 47 | public String build() { 48 | return response.toString(); 49 | } 50 | 51 | /** 52 | * Add a method to the list 53 | * 54 | * @param method method 55 | * @return builder 56 | */ 57 | public AppendToResponseBuilder add(AppendToResponseMethod method) { 58 | response.append(",").append(method.getPropertyString()); 59 | return this; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/MovieDbException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi; 21 | 22 | import java.net.URL; 23 | import org.yamj.api.common.exception.ApiException; 24 | import org.yamj.api.common.exception.ApiExceptionType; 25 | 26 | public class MovieDbException extends ApiException { 27 | 28 | public MovieDbException(ApiExceptionType exceptionType, String response) { 29 | super(exceptionType, response); 30 | } 31 | 32 | public MovieDbException(ApiExceptionType exceptionType, String response, URL url) { 33 | super(exceptionType, response, url); 34 | } 35 | 36 | public MovieDbException(ApiExceptionType exceptionType, String response, int responseCode, URL url) { 37 | super(exceptionType, response, responseCode, url); 38 | } 39 | 40 | public MovieDbException(ApiExceptionType exceptionType, String response, String url) { 41 | super(exceptionType, response, url); 42 | } 43 | 44 | public MovieDbException(ApiExceptionType exceptionType, String response, int responseCode, String url) { 45 | super(exceptionType, response, responseCode, url); 46 | } 47 | 48 | public MovieDbException(ApiExceptionType exceptionType, String response, URL url, Throwable cause) { 49 | super(exceptionType, response, url, cause); 50 | } 51 | 52 | public MovieDbException(ApiExceptionType exceptionType, String response, int responseCode, URL url, Throwable cause) { 53 | super(exceptionType, response, responseCode, url, cause); 54 | } 55 | 56 | public MovieDbException(ApiExceptionType exceptionType, String response, String url, Throwable cause) { 57 | super(exceptionType, response, url, cause); 58 | } 59 | 60 | public MovieDbException(ApiExceptionType exceptionType, String response, int responseCode, String url, Throwable cause) { 61 | super(exceptionType, response, responseCode, url, cause); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/ArtworkType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | import org.apache.commons.lang3.StringUtils; 23 | 24 | /** 25 | * ArtworkType enum List of the artwork types that are available 26 | */ 27 | public enum ArtworkType { 28 | 29 | /** 30 | * Poster artwork 31 | */ 32 | POSTER, 33 | /** 34 | * Fanart/backdrop 35 | */ 36 | BACKDROP, 37 | /** 38 | * Person image 39 | */ 40 | PROFILE, 41 | /** 42 | * Still (Video image) 43 | */ 44 | STILL; 45 | 46 | /** 47 | * Convert a string into an Enum type 48 | * 49 | * @param artworkType String to convert to enum 50 | * @return enum version of param 51 | * @throws IllegalArgumentException If type is not recognised 52 | * 53 | */ 54 | public static ArtworkType fromString(String artworkType) { 55 | if (StringUtils.isNotBlank(artworkType)) { 56 | try { 57 | return ArtworkType.valueOf(artworkType.trim().toUpperCase()); 58 | } catch (IllegalArgumentException ex) { 59 | throw new IllegalArgumentException("ArtworkType " + artworkType + " does not exist.", ex); 60 | } 61 | } 62 | throw new IllegalArgumentException("ArtworkType must not be null"); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/CreditType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | /** 23 | * 24 | * @author Stuart 25 | */ 26 | public enum CreditType { 27 | 28 | CAST, 29 | CREW; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/ExternalSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | /** 23 | * 24 | * @author Stuart 25 | */ 26 | public enum ExternalSource { 27 | 28 | FREEBASE_ID, 29 | FREEBASE_MID, 30 | IMDB_ID, 31 | TVDB_ID, 32 | TVRAGE_ID; 33 | 34 | public String getPropertyString() { 35 | return this.name().toLowerCase(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/Gender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | public enum Gender { 23 | MALE(2), 24 | FEMALE(1), 25 | UNKNOWN(0); 26 | 27 | private final int type; 28 | 29 | private Gender(int type) { 30 | this.type = type; 31 | } 32 | 33 | /** 34 | * Get the gender from an integer type 35 | * 36 | * @param type Integer to convert to enum 37 | * @return enum version of param 38 | */ 39 | public static Gender fromInteger(int type) { 40 | for (Gender gender : Gender.values()) { 41 | if (gender.type == type) { 42 | return gender; 43 | } 44 | } 45 | return UNKNOWN; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/MediaType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | import org.apache.commons.lang3.StringUtils; 23 | 24 | /** 25 | * Media type options 26 | * 27 | * @author Stuart 28 | */ 29 | public enum MediaType { 30 | 31 | /** 32 | * Movie media type 33 | */ 34 | MOVIE, 35 | /** 36 | * TV Show media type 37 | */ 38 | TV, 39 | /** 40 | * TV Season media type 41 | */ 42 | SEASON, 43 | /** 44 | * TV Episode media type 45 | */ 46 | EPISODE; 47 | 48 | /** 49 | * Convert a string into an Enum type 50 | * 51 | * @param mediaType String to convert to enum 52 | * @return enum version of param 53 | * @throws IllegalArgumentException If type is not recognised 54 | * 55 | */ 56 | public static MediaType fromString(String mediaType) { 57 | if (StringUtils.isNotBlank(mediaType)) { 58 | try { 59 | return MediaType.valueOf(mediaType.trim().toUpperCase()); 60 | } catch (IllegalArgumentException ex) { 61 | throw new IllegalArgumentException("MediaType " + mediaType + " does not exist.", ex); 62 | } 63 | } 64 | throw new IllegalArgumentException("MediaType must not be null"); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/MovieMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | import com.omertron.themoviedbapi.interfaces.AppendToResponseMethod; 23 | import org.apache.commons.lang3.StringUtils; 24 | 25 | /** 26 | * List of all "Append To Response" movie methods 27 | * 28 | * @author Stuart 29 | */ 30 | public enum MovieMethod implements AppendToResponseMethod { 31 | 32 | ALTERNATIVE_TITLES, 33 | CHANGES, 34 | CREDITS, 35 | IMAGES, 36 | KEYWORDS, 37 | LISTS, 38 | RECOMMENDATIONS, 39 | RELEASES, 40 | REVIEWS, 41 | SIMILAR, 42 | TRANSLATIONS, 43 | VIDEOS; 44 | 45 | /** 46 | * Get the string to use in the URL 47 | * 48 | * @return the string representation of the enum 49 | */ 50 | @Override 51 | public String getPropertyString() { 52 | return this.name().toLowerCase(); 53 | } 54 | 55 | /** 56 | * Convert a string into an Enum type 57 | * 58 | * @param method String to convert to enum 59 | * @return enum version of param 60 | * @throws IllegalArgumentException If type is not recognised 61 | * 62 | */ 63 | public static MovieMethod fromString(String method) { 64 | if (StringUtils.isNotBlank(method)) { 65 | try { 66 | return MovieMethod.valueOf(method.trim().toUpperCase()); 67 | } catch (IllegalArgumentException ex) { 68 | throw new IllegalArgumentException("Method " + method + " does not exist.", ex); 69 | } 70 | } 71 | throw new IllegalArgumentException("Method must not be null"); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/PeopleMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | import com.omertron.themoviedbapi.interfaces.AppendToResponseMethod; 23 | import org.apache.commons.lang3.StringUtils; 24 | 25 | /** 26 | * List of People methods 27 | * 28 | * @author Stuart 29 | */ 30 | public enum PeopleMethod implements AppendToResponseMethod { 31 | 32 | CHANGES, 33 | COMBINED_CREDITS, 34 | EXTERNAL_IDS, 35 | IMAGES, 36 | MOVIE_CREDITS, 37 | TAGGED_IMAGES, 38 | TV_CREDITS; 39 | 40 | /** 41 | * Get the string to use in the URL 42 | * 43 | * @return the string representation of the enum 44 | */ 45 | @Override 46 | public String getPropertyString() { 47 | return this.name().toLowerCase(); 48 | } 49 | 50 | /** 51 | * Convert a string into an Enum type 52 | * 53 | * @param method String to convert to enum 54 | * @return enum version of param 55 | * @throws IllegalArgumentException If type is not recognised 56 | * 57 | */ 58 | public static PeopleMethod fromString(String method) { 59 | if (StringUtils.isNotBlank(method)) { 60 | try { 61 | return PeopleMethod.valueOf(method.trim().toUpperCase()); 62 | } catch (IllegalArgumentException ex) { 63 | throw new IllegalArgumentException("Method " + method + " does not exist.", ex); 64 | } 65 | } 66 | throw new IllegalArgumentException("Method must not be null"); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/ReleaseType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | /** 23 | * Release Type for the video 24 | * 25 | * @author stuar 26 | */ 27 | public enum ReleaseType { 28 | PREMIERE(1), 29 | THEATRICAL_LIMITED(2), 30 | THEATRICAL(3), 31 | DIGITAL(4), 32 | PHYSICAL(5), 33 | TV(6), 34 | UNKNOWN(0); 35 | 36 | private final int type; 37 | 38 | private ReleaseType(int type) { 39 | this.type = type; 40 | } 41 | 42 | /** 43 | * Get the Release Type from an integer type 44 | * 45 | * @param type Integer to convert to enum 46 | * @return enum version of param 47 | */ 48 | public static ReleaseType fromInteger(int type) { 49 | for (ReleaseType rt : ReleaseType.values()) { 50 | if (rt.type == type) { 51 | return rt; 52 | } 53 | } 54 | return UNKNOWN; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/SearchType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | /** 23 | * 24 | * @author Stuart 25 | */ 26 | public enum SearchType { 27 | 28 | PHRASE, 29 | NGRAM; 30 | 31 | public String getPropertyString() { 32 | return this.name().toLowerCase(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/SortBy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | public enum SortBy { 23 | 24 | CREATED_AT_ASC, 25 | CREATED_AT_DESC, 26 | POPULARITY_ASC, 27 | POPULARITY_DESC, 28 | RELEASE_DATE_ASC, 29 | RELEASE_DATE_DESC, 30 | REVENUE_ASC, 31 | REVENUE_DESC, 32 | PRIMARY_RELEASE_DATE_ASC, 33 | PRIMARY_RELEASE_DATE_DESC, 34 | ORIGINAL_TITLE_ASC, 35 | ORIGINAL_TITLE_DESC, 36 | VOTE_AVERAGE_ASC, 37 | VOTE_AVERAGE_DESC, 38 | VOTE_COUNT_ASC, 39 | VOTE_COUNT_DESC; 40 | 41 | public String getPropertyString() { 42 | return this.name().toLowerCase().replace("_asc", ".asc").replaceAll("_desc", ".desc"); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/TVEpisodeMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | import com.omertron.themoviedbapi.interfaces.AppendToResponseMethod; 23 | import org.apache.commons.lang3.StringUtils; 24 | 25 | /** 26 | * List of TV methods 27 | * 28 | * @author Stuart 29 | */ 30 | public enum TVEpisodeMethod implements AppendToResponseMethod { 31 | 32 | CREDITS, 33 | EXTERNAL_IDS, 34 | IMAGES, 35 | VIDEOS; 36 | 37 | /** 38 | * Get the string to use in the URL 39 | * 40 | * @return the string representation of the enum 41 | */ 42 | @Override 43 | public String getPropertyString() { 44 | return this.name().toLowerCase(); 45 | } 46 | 47 | /** 48 | * Convert a string into an Enum type 49 | * 50 | * @param method String to convert to enum 51 | * @return enum version of param 52 | * @throws IllegalArgumentException If type is not recognised 53 | * 54 | */ 55 | public static TVEpisodeMethod fromString(String method) { 56 | if (StringUtils.isNotBlank(method)) { 57 | try { 58 | return TVEpisodeMethod.valueOf(method.trim().toUpperCase()); 59 | } catch (IllegalArgumentException ex) { 60 | throw new IllegalArgumentException("Method " + method + " does not exist.", ex); 61 | } 62 | } 63 | throw new IllegalArgumentException("Method must not be null"); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/TVMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | import com.omertron.themoviedbapi.interfaces.AppendToResponseMethod; 23 | import org.apache.commons.lang3.StringUtils; 24 | 25 | /** 26 | * List of TV methods 27 | * 28 | * @author Stuart 29 | */ 30 | public enum TVMethod implements AppendToResponseMethod { 31 | 32 | ALTERNATIVE_TITLES, 33 | CHANGES, 34 | CONTENT_RATINGS, 35 | CREDITS, 36 | EXTERNAL_IDS, 37 | IMAGES, 38 | KEYWORDS, 39 | SIMILAR, 40 | TRANSLATIONS, 41 | VIDEOS; 42 | 43 | /** 44 | * Get the string to use in the URL 45 | * 46 | * @return 47 | */ 48 | @Override 49 | public String getPropertyString() { 50 | return this.name().toLowerCase(); 51 | } 52 | 53 | /** 54 | * Convert a string into an Enum type 55 | * 56 | * @param method 57 | * @return 58 | * @throws IllegalArgumentException If type is not recognised 59 | * 60 | */ 61 | public static TVMethod fromString(String method) { 62 | if (StringUtils.isNotBlank(method)) { 63 | try { 64 | return TVMethod.valueOf(method.trim().toUpperCase()); 65 | } catch (IllegalArgumentException ex) { 66 | throw new IllegalArgumentException("Method " + method + " does not exist.", ex); 67 | } 68 | } 69 | throw new IllegalArgumentException("Method must not be null"); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/enumeration/TVSeasonMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.enumeration; 21 | 22 | import com.omertron.themoviedbapi.interfaces.AppendToResponseMethod; 23 | import org.apache.commons.lang3.StringUtils; 24 | 25 | /** 26 | * List of TV methods 27 | * 28 | * @author Stuart 29 | */ 30 | public enum TVSeasonMethod implements AppendToResponseMethod { 31 | 32 | CREDITS, 33 | EXTERNAL_IDS, 34 | IMAGES, 35 | VIDEOS; 36 | 37 | /** 38 | * Get the string to use in the URL 39 | * 40 | * @return 41 | */ 42 | @Override 43 | public String getPropertyString() { 44 | return this.name().toLowerCase(); 45 | } 46 | 47 | /** 48 | * Convert a string into an Enum type 49 | * 50 | * @param method 51 | * @return 52 | * @throws IllegalArgumentException If type is not recognised 53 | * 54 | */ 55 | public static TVSeasonMethod fromString(String method) { 56 | if (StringUtils.isNotBlank(method)) { 57 | try { 58 | return TVSeasonMethod.valueOf(method.trim().toUpperCase()); 59 | } catch (IllegalArgumentException ex) { 60 | throw new IllegalArgumentException("Method " + method + " does not exist.", ex); 61 | } 62 | } 63 | throw new IllegalArgumentException("Method must not be null"); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/interfaces/AppendToResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.interfaces; 21 | 22 | /** 23 | * Interface to indicate that the object has append to response methods 24 | * 25 | * @author Stuart 26 | * @param Method for Append To Response 27 | */ 28 | public interface AppendToResponse { 29 | 30 | boolean hasMethod(T method); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/interfaces/AppendToResponseMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.interfaces; 21 | 22 | public interface AppendToResponseMethod { 23 | 24 | String getPropertyString(); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/interfaces/Identification.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.interfaces; 21 | 22 | public interface Identification { 23 | 24 | int getId(); 25 | 26 | void setId(int id); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/interfaces/WrapperDates.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.interfaces; 21 | 22 | import com.omertron.themoviedbapi.results.ResultDates; 23 | 24 | public interface WrapperDates { 25 | 26 | ResultDates getDates(); 27 | 28 | void setDates(ResultDates dates); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/interfaces/WrapperPages.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.interfaces; 21 | 22 | public interface WrapperPages { 23 | 24 | int getPage(); 25 | 26 | void setPage(int page); 27 | 28 | int getTotalPages(); 29 | 30 | void setTotalPages(int totalPages); 31 | 32 | int getTotalResults(); 33 | 34 | void setTotalResults(int totalResults); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/methods/TmdbChanges.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.methods; 21 | 22 | import com.omertron.themoviedbapi.MovieDbException; 23 | import com.omertron.themoviedbapi.model.change.ChangeListItem; 24 | import com.omertron.themoviedbapi.results.ResultList; 25 | import com.omertron.themoviedbapi.tools.ApiUrl; 26 | import com.omertron.themoviedbapi.tools.HttpTools; 27 | import com.omertron.themoviedbapi.tools.MethodBase; 28 | import com.omertron.themoviedbapi.tools.MethodSub; 29 | import com.omertron.themoviedbapi.tools.Param; 30 | import com.omertron.themoviedbapi.tools.TmdbParameters; 31 | import com.omertron.themoviedbapi.results.WrapperGenericList; 32 | import java.net.URL; 33 | 34 | /** 35 | * Class to hold the Change Methods 36 | * 37 | * @author stuart.boston 38 | */ 39 | public class TmdbChanges extends AbstractMethod { 40 | 41 | /** 42 | * Constructor 43 | * 44 | * @param apiKey 45 | * @param httpTools 46 | */ 47 | public TmdbChanges(String apiKey, HttpTools httpTools) { 48 | super(apiKey, httpTools); 49 | } 50 | 51 | /** 52 | * Get a list of Media IDs that have been edited. 53 | * 54 | * You can then use the movie/TV/person changes API to get the actual data that has been changed. 55 | * 56 | * @param method The method base to get 57 | * @param page 58 | * @param startDate the start date of the changes, optional 59 | * @param endDate the end date of the changes, optional 60 | * @return List of changed movie 61 | * @throws MovieDbException 62 | */ 63 | public ResultList getChangeList(MethodBase method, Integer page, String startDate, String endDate) throws MovieDbException { 64 | TmdbParameters params = new TmdbParameters(); 65 | params.add(Param.PAGE, page); 66 | params.add(Param.START_DATE, startDate); 67 | params.add(Param.END_DATE, endDate); 68 | 69 | URL url = new ApiUrl(apiKey, method).subMethod(MethodSub.CHANGES).buildUrl(params); 70 | WrapperGenericList wrapper = processWrapper(getTypeReference(ChangeListItem.class), url, "changes"); 71 | return wrapper.getResultsList(); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/methods/TmdbNetworks.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.methods; 21 | 22 | import com.omertron.themoviedbapi.MovieDbException; 23 | import com.omertron.themoviedbapi.model.network.Network; 24 | import com.omertron.themoviedbapi.tools.ApiUrl; 25 | import com.omertron.themoviedbapi.tools.HttpTools; 26 | import com.omertron.themoviedbapi.tools.MethodBase; 27 | import com.omertron.themoviedbapi.tools.Param; 28 | import com.omertron.themoviedbapi.tools.TmdbParameters; 29 | import java.io.IOException; 30 | import java.net.URL; 31 | import org.yamj.api.common.exception.ApiExceptionType; 32 | 33 | /** 34 | * Class to hold the Network Methods 35 | * 36 | * @author stuart.boston 37 | */ 38 | public class TmdbNetworks extends AbstractMethod { 39 | 40 | /** 41 | * Constructor 42 | * 43 | * @param apiKey 44 | * @param httpTools 45 | */ 46 | public TmdbNetworks(String apiKey, HttpTools httpTools) { 47 | super(apiKey, httpTools); 48 | } 49 | 50 | /** 51 | * This method is used to retrieve the basic information about a TV network. 52 | *

53 | * You can use this ID to search for TV shows with the discover method. 54 | * 55 | * @param networkId 56 | * @return 57 | * @throws MovieDbException 58 | */ 59 | public Network getNetworkInfo(int networkId) throws MovieDbException { 60 | TmdbParameters parameters = new TmdbParameters(); 61 | parameters.add(Param.ID, networkId); 62 | 63 | URL url = new ApiUrl(apiKey, MethodBase.NETWORK).buildUrl(parameters); 64 | String webpage = httpTools.getRequest(url); 65 | 66 | try { 67 | return MAPPER.readValue(webpage, Network.class); 68 | } catch (IOException ex) { 69 | throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get network information", url, ex); 70 | } 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/methods/TmdbReviews.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.methods; 21 | 22 | import com.omertron.themoviedbapi.MovieDbException; 23 | import static com.omertron.themoviedbapi.methods.AbstractMethod.MAPPER; 24 | import com.omertron.themoviedbapi.model.review.Review; 25 | import com.omertron.themoviedbapi.tools.ApiUrl; 26 | import com.omertron.themoviedbapi.tools.HttpTools; 27 | import com.omertron.themoviedbapi.tools.MethodBase; 28 | import com.omertron.themoviedbapi.tools.Param; 29 | import com.omertron.themoviedbapi.tools.TmdbParameters; 30 | import java.io.IOException; 31 | import java.net.URL; 32 | import org.yamj.api.common.exception.ApiExceptionType; 33 | 34 | /** 35 | * Class to hold the Review Methods 36 | * 37 | * @author stuart.boston 38 | */ 39 | public class TmdbReviews extends AbstractMethod { 40 | 41 | /** 42 | * Constructor 43 | * 44 | * @param apiKey 45 | * @param httpTools 46 | */ 47 | public TmdbReviews(String apiKey, HttpTools httpTools) { 48 | super(apiKey, httpTools); 49 | } 50 | 51 | /** 52 | * Get the full details of a review by ID. 53 | * 54 | * @param reviewId 55 | * @return 56 | * @throws MovieDbException 57 | */ 58 | public Review getReview(String reviewId) throws MovieDbException { 59 | TmdbParameters parameters = new TmdbParameters(); 60 | parameters.add(Param.ID, reviewId); 61 | 62 | URL url = new ApiUrl(apiKey, MethodBase.REVIEW).buildUrl(parameters); 63 | String webpage = httpTools.getRequest(url); 64 | 65 | try { 66 | return MAPPER.readValue(webpage, Review.class); 67 | } catch (IOException ex) { 68 | throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get review", url, ex); 69 | } 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/AbstractIdName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation;private either version 3 of the License;private or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful;private 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not;private see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.interfaces.Identification; 24 | import java.io.Serializable; 25 | import org.apache.commons.lang3.builder.EqualsBuilder; 26 | import org.apache.commons.lang3.builder.HashCodeBuilder; 27 | 28 | /** 29 | * 30 | * @author Stuart.Boston 31 | */ 32 | public class AbstractIdName extends AbstractJsonMapping implements Serializable, Identification { 33 | 34 | private static final long serialVersionUID = 100L; 35 | 36 | @JsonProperty("id") 37 | private int id; 38 | @JsonProperty("name") 39 | private String name; 40 | 41 | @Override 42 | public int getId() { 43 | return id; 44 | } 45 | 46 | public String getName() { 47 | return name; 48 | } 49 | 50 | @Override 51 | public void setId(int id) { 52 | this.id = id; 53 | } 54 | 55 | public void setName(String name) { 56 | this.name = name; 57 | } 58 | 59 | @Override 60 | public boolean equals(final Object obj) { 61 | if (obj instanceof AbstractIdName) { 62 | final AbstractIdName other = (AbstractIdName) obj; 63 | return new EqualsBuilder() 64 | .append(name, other.name) 65 | .append(id, other.id) 66 | .isEquals(); 67 | } else { 68 | return false; 69 | } 70 | } 71 | 72 | @Override 73 | public int hashCode() { 74 | return new HashCodeBuilder() 75 | .append(id) 76 | .append(name) 77 | .toHashCode(); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/AbstractJsonMapping.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation;private either version 3 of the License;private or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful;private 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not;private see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model; 21 | 22 | import com.fasterxml.jackson.annotation.JsonAnySetter; 23 | import java.io.Serializable; 24 | import org.apache.commons.lang3.builder.ToStringBuilder; 25 | import org.apache.commons.lang3.builder.ToStringStyle; 26 | import org.slf4j.Logger; 27 | import org.slf4j.LoggerFactory; 28 | 29 | /** 30 | * Abstract class to handle any unknown properties by outputting a log message 31 | * 32 | * @author stuart.boston 33 | */ 34 | public abstract class AbstractJsonMapping implements Serializable { 35 | 36 | private static final long serialVersionUID = 100L; 37 | private static final Logger LOG = LoggerFactory.getLogger(AbstractJsonMapping.class); 38 | 39 | /** 40 | * Handle unknown properties and print a message 41 | * 42 | * @param key 43 | * @param value 44 | */ 45 | @JsonAnySetter 46 | protected void handleUnknown(String key, Object value) { 47 | StringBuilder unknown = new StringBuilder(this.getClass().getSimpleName()); 48 | unknown.append(": Unknown property='").append(key) 49 | .append("' value='").append(value).append("'"); 50 | 51 | LOG.trace(unknown.toString()); 52 | } 53 | 54 | @Override 55 | public String toString() { 56 | return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/Certification.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation;private either version 3 of the License;private or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful;private 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not;private see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.fasterxml.jackson.annotation.JsonRootName; 24 | import java.io.Serializable; 25 | 26 | @JsonRootName("certification") 27 | public class Certification extends AbstractJsonMapping implements Serializable { 28 | 29 | private static final long serialVersionUID = 100L; 30 | // Properties 31 | @JsonProperty("certification") 32 | private String value; 33 | @JsonProperty("meaning") 34 | private String meaning; 35 | @JsonProperty("order") 36 | private int order; 37 | 38 | public String getValue() { 39 | return value; 40 | } 41 | 42 | public void setValue(String value) { 43 | this.value = value; 44 | } 45 | 46 | public String getMeaning() { 47 | return meaning; 48 | } 49 | 50 | public void setMeaning(String meaning) { 51 | this.meaning = meaning; 52 | } 53 | 54 | public int getOrder() { 55 | return order; 56 | } 57 | 58 | public void setOrder(int order) { 59 | this.order = order; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/FindResults.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.movie.MovieBasic; 24 | import com.omertron.themoviedbapi.model.person.PersonFind; 25 | import com.omertron.themoviedbapi.model.tv.TVBasic; 26 | import com.omertron.themoviedbapi.model.tv.TVEpisodeBasic; 27 | import com.omertron.themoviedbapi.model.tv.TVSeasonBasic; 28 | import java.io.Serializable; 29 | import java.util.List; 30 | 31 | /** 32 | * @author stuart.boston 33 | */ 34 | public class FindResults extends AbstractJsonMapping implements Serializable { 35 | 36 | private static final long serialVersionUID = 100L; 37 | 38 | @JsonProperty("movie_results") 39 | private List movieResults; 40 | @JsonProperty("person_results") 41 | private List personResults; 42 | @JsonProperty("tv_results") 43 | private List tvResults; 44 | @JsonProperty("tv_season_results") 45 | private List tvSeasonResults; 46 | @JsonProperty("tv_episode_results") 47 | private List tvEpisodeResults; 48 | 49 | public List getMovieResults() { 50 | return movieResults; 51 | } 52 | 53 | public void setMovieResults(List movieResults) { 54 | this.movieResults = movieResults; 55 | } 56 | 57 | public List getPersonResults() { 58 | return personResults; 59 | } 60 | 61 | public void setPersonResults(List personResults) { 62 | this.personResults = personResults; 63 | } 64 | 65 | public List getTvResults() { 66 | return tvResults; 67 | } 68 | 69 | public void setTvResults(List tvResults) { 70 | this.tvResults = tvResults; 71 | } 72 | 73 | public List getTvSeasonResults() { 74 | return tvSeasonResults; 75 | } 76 | 77 | public void setTvSeasonResults(List tvSeasonResults) { 78 | this.tvSeasonResults = tvSeasonResults; 79 | } 80 | 81 | public List getTvEpisodeResults() { 82 | return tvEpisodeResults; 83 | } 84 | 85 | public void setTvEpisodeResults(List tvEpisodeResults) { 86 | this.tvEpisodeResults = tvEpisodeResults; 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/Genre.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model; 21 | 22 | import com.fasterxml.jackson.annotation.JsonRootName; 23 | import java.io.Serializable; 24 | 25 | /** 26 | * @author stuart.boston 27 | */ 28 | @JsonRootName("genre") 29 | public class Genre extends AbstractIdName implements Serializable { 30 | 31 | private static final long serialVersionUID = 100L; 32 | // Nothing to override from the base class. 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/Language.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.fasterxml.jackson.annotation.JsonRootName; 24 | import java.io.Serializable; 25 | import org.apache.commons.lang3.builder.EqualsBuilder; 26 | import org.apache.commons.lang3.builder.HashCodeBuilder; 27 | 28 | /** 29 | * @author stuart.boston 30 | */ 31 | @JsonRootName("spoken_language") 32 | public class Language extends AbstractJsonMapping implements Serializable { 33 | 34 | private static final long serialVersionUID = 100L; 35 | 36 | @JsonProperty("iso_639_1") 37 | private String code; 38 | @JsonProperty("name") 39 | private String name; 40 | 41 | public String getCode() { 42 | return code; 43 | } 44 | 45 | public String getName() { 46 | return name; 47 | } 48 | 49 | public void setCode(String code) { 50 | this.code = code; 51 | } 52 | 53 | public void setName(String name) { 54 | this.name = name; 55 | } 56 | 57 | @Override 58 | public boolean equals(Object obj) { 59 | if (obj instanceof Language) { 60 | final Language other = (Language) obj; 61 | return new EqualsBuilder() 62 | .append(code, other.code) 63 | .append(name, other.name) 64 | .isEquals(); 65 | } else { 66 | return false; 67 | } 68 | } 69 | 70 | @Override 71 | public int hashCode() { 72 | return new HashCodeBuilder() 73 | .append(code) 74 | .append(name) 75 | .toHashCode(); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/StatusCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | 24 | /** 25 | * @author Stuart 26 | */ 27 | public class StatusCode extends AbstractJsonMapping { 28 | 29 | private static final long serialVersionUID = 100L; 30 | 31 | @JsonProperty("status_code") 32 | private int code; 33 | @JsonProperty("status_message") 34 | private String message; 35 | 36 | public int getCode() { 37 | return code; 38 | } 39 | 40 | public void setCode(int code) { 41 | this.code = code; 42 | } 43 | 44 | public String getMessage() { 45 | return message; 46 | } 47 | 48 | public void setMessage(String message) { 49 | this.message = message; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/account/Account.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation;private either version 3 of the License;private or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful;private 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not;private see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.account; 21 | 22 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 23 | import com.fasterxml.jackson.annotation.JsonProperty; 24 | import com.omertron.themoviedbapi.interfaces.Identification; 25 | 26 | public class Account extends AbstractJsonMapping implements Identification { 27 | 28 | private static final long serialVersionUID = 100L; 29 | 30 | @JsonProperty("id") 31 | private int id; 32 | @JsonProperty("name") 33 | private String name; 34 | @JsonProperty("username") 35 | private String userName; 36 | @JsonProperty("include_adult") 37 | private boolean includeAdult; 38 | @JsonProperty("iso_639_1") 39 | private String language; 40 | @JsonProperty("iso_3166_1") 41 | private String country; 42 | @JsonProperty("avatar") 43 | private Avatar avatar; 44 | 45 | @Override 46 | public int getId() { 47 | return id; 48 | } 49 | 50 | @Override 51 | public void setId(int id) { 52 | this.id = id; 53 | } 54 | 55 | public String getName() { 56 | return name; 57 | } 58 | 59 | public void setName(String name) { 60 | this.name = name; 61 | } 62 | 63 | public boolean isIncludeAdult() { 64 | return includeAdult; 65 | } 66 | 67 | public void setIncludeAdult(boolean includeAdult) { 68 | this.includeAdult = includeAdult; 69 | } 70 | 71 | public String getUserName() { 72 | return userName; 73 | } 74 | 75 | public void setUserName(String userName) { 76 | this.userName = userName; 77 | } 78 | 79 | public String getLanguage() { 80 | return language; 81 | } 82 | 83 | public void setLanguage(String language) { 84 | this.language = language; 85 | } 86 | 87 | public String getCountry() { 88 | return country; 89 | } 90 | 91 | public void setCountry(String country) { 92 | this.country = country; 93 | } 94 | 95 | public Avatar getAvatar() { 96 | return avatar; 97 | } 98 | 99 | public void setAvatar(Avatar avatar) { 100 | this.avatar = avatar; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/account/Avatar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation;private either version 3 of the License;private or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful;private 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not;private see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.account; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 24 | 25 | public class Avatar extends AbstractJsonMapping { 26 | 27 | @JsonProperty("gravatar") 28 | private AvatarHash hash = null; 29 | 30 | public String getHash() { 31 | return hash == null ? "" : hash.getHash(); 32 | } 33 | 34 | public void setHash(AvatarHash hash) { 35 | this.hash = hash; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/account/AvatarHash.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation;private either version 3 of the License;private or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful;private 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not;private see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.account; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 24 | 25 | public class AvatarHash extends AbstractJsonMapping { 26 | 27 | @JsonProperty("hash") 28 | private String hash; 29 | 30 | public String getHash() { 31 | return hash; 32 | } 33 | 34 | public void setHash(String hash) { 35 | this.hash = hash; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/authentication/TokenAuthorisation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.authentication; 21 | 22 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 23 | import com.fasterxml.jackson.annotation.JsonProperty; 24 | import java.io.Serializable; 25 | 26 | public class TokenAuthorisation extends AbstractJsonMapping implements Serializable { 27 | 28 | private static final long serialVersionUID = 100L; 29 | @JsonProperty("expires_at") 30 | private String expires; 31 | @JsonProperty("request_token") 32 | private String requestToken; 33 | @JsonProperty("success") 34 | private Boolean success; 35 | 36 | public String getExpires() { 37 | return expires; 38 | } 39 | 40 | public String getRequestToken() { 41 | return requestToken; 42 | } 43 | 44 | public Boolean getSuccess() { 45 | return success; 46 | } 47 | 48 | public void setExpires(String expires) { 49 | this.expires = expires; 50 | } 51 | 52 | public void setRequestToken(String requestToken) { 53 | this.requestToken = requestToken; 54 | } 55 | 56 | public void setSuccess(Boolean success) { 57 | this.success = success; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/authentication/TokenSession.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.authentication; 21 | 22 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 23 | import com.fasterxml.jackson.annotation.JsonProperty; 24 | import java.io.Serializable; 25 | 26 | public class TokenSession extends AbstractJsonMapping implements Serializable { 27 | 28 | private static final long serialVersionUID = 100L; 29 | @JsonProperty("session_id") 30 | private String sessionId; 31 | @JsonProperty("success") 32 | private Boolean success; 33 | @JsonProperty("status_code") 34 | private String statusCode; 35 | @JsonProperty("status_message") 36 | private String statusMessage; 37 | @JsonProperty("guest_session_id") 38 | private String guestSessionId; 39 | @JsonProperty("expires_at") 40 | private String expiresAt; 41 | 42 | public String getSessionId() { 43 | return sessionId; 44 | } 45 | 46 | public Boolean getSuccess() { 47 | return success; 48 | } 49 | 50 | public String getStatusCode() { 51 | return statusCode; 52 | } 53 | 54 | public String getStatusMessage() { 55 | return statusMessage; 56 | } 57 | 58 | public String getGuestSessionId() { 59 | return guestSessionId; 60 | } 61 | 62 | public String getExpiresAt() { 63 | return expiresAt; 64 | } 65 | 66 | public void setSessionId(String sessionId) { 67 | this.sessionId = sessionId; 68 | } 69 | 70 | public void setSuccess(Boolean success) { 71 | this.success = success; 72 | } 73 | 74 | public void setStatusCode(String statusCode) { 75 | this.statusCode = statusCode; 76 | } 77 | 78 | public void setStatusMessage(String statusMessage) { 79 | this.statusMessage = statusMessage; 80 | } 81 | 82 | public void setGuestSessionId(String guestSessionId) { 83 | this.guestSessionId = guestSessionId; 84 | } 85 | 86 | public void setExpiresAt(String expiresAt) { 87 | this.expiresAt = expiresAt; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/change/ChangeKeyItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.change; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 24 | import java.io.Serializable; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | public class ChangeKeyItem extends AbstractJsonMapping implements Serializable { 29 | 30 | private static final long serialVersionUID = 100L; 31 | @JsonProperty("key") 32 | private String key; 33 | @JsonProperty("items") 34 | private List changedItems = new ArrayList<>(); 35 | 36 | public String getKey() { 37 | return key; 38 | } 39 | 40 | public void setKey(String key) { 41 | this.key = key; 42 | } 43 | 44 | public List getChangedItems() { 45 | return changedItems; 46 | } 47 | 48 | public void setChangedItems(List changes) { 49 | this.changedItems = changes; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/change/ChangeListItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.change; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 24 | import java.io.Serializable; 25 | 26 | public class ChangeListItem extends AbstractJsonMapping implements Serializable { 27 | 28 | private static final long serialVersionUID = 100L; 29 | 30 | @JsonProperty("id") 31 | private int id; 32 | @JsonProperty("adult") 33 | private boolean adult; 34 | 35 | public int getId() { 36 | return id; 37 | } 38 | 39 | public boolean isAdult() { 40 | return adult; 41 | } 42 | 43 | public void setId(int id) { 44 | this.id = id; 45 | } 46 | 47 | public void setAdult(boolean adult) { 48 | this.adult = adult; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/change/ChangedItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.change; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 24 | import java.io.Serializable; 25 | 26 | public class ChangedItem extends AbstractJsonMapping implements Serializable { 27 | 28 | private static final long serialVersionUID = 100L; 29 | @JsonProperty("id") 30 | private String id; 31 | @JsonProperty("action") 32 | private String action; 33 | @JsonProperty("time") 34 | private String time; 35 | @JsonProperty("iso_639_1") 36 | private String language; 37 | @JsonProperty("value") 38 | private Object value; 39 | @JsonProperty("original_value") 40 | private Object originalValue; 41 | 42 | public String getId() { 43 | return id; 44 | } 45 | 46 | public void setId(String id) { 47 | this.id = id; 48 | } 49 | 50 | public String getAction() { 51 | return action; 52 | } 53 | 54 | public void setAction(String action) { 55 | this.action = action; 56 | } 57 | 58 | public String getTime() { 59 | return time; 60 | } 61 | 62 | public void setTime(String time) { 63 | this.time = time; 64 | } 65 | 66 | public String getLanguage() { 67 | return language; 68 | } 69 | 70 | public void setLanguage(String language) { 71 | this.language = language; 72 | } 73 | 74 | public Object getValue() { 75 | return value; 76 | } 77 | 78 | public void setValue(Object value) { 79 | this.value = value; 80 | } 81 | 82 | public Object getOriginalValue() { 83 | return originalValue; 84 | } 85 | 86 | public void setOriginalValue(Object originalValue) { 87 | this.originalValue = originalValue; 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/collection/CollectionInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.collection; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.interfaces.Identification; 24 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 25 | import java.io.Serializable; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @author Stuart 32 | */ 33 | public class CollectionInfo extends AbstractJsonMapping implements Serializable, Identification { 34 | 35 | private static final long serialVersionUID = 100L; 36 | 37 | @JsonProperty("id") 38 | private int id; 39 | @JsonProperty("name") 40 | private String name; 41 | @JsonProperty("overview") 42 | private String overview; 43 | @JsonProperty("poster_path") 44 | private String posterPath; 45 | @JsonProperty("backdrop_path") 46 | private String backdropPath; 47 | @JsonProperty("parts") 48 | private List parts = new ArrayList<>(); 49 | 50 | public String getBackdropPath() { 51 | return backdropPath; 52 | } 53 | 54 | @Override 55 | public int getId() { 56 | return id; 57 | } 58 | 59 | public String getName() { 60 | return name; 61 | } 62 | 63 | public String getOverview() { 64 | return overview; 65 | } 66 | 67 | public List getParts() { 68 | return parts; 69 | } 70 | 71 | public String getPosterPath() { 72 | return posterPath; 73 | } 74 | 75 | public void setBackdropPath(String backdropPath) { 76 | this.backdropPath = backdropPath; 77 | } 78 | 79 | @Override 80 | public void setId(int id) { 81 | this.id = id; 82 | } 83 | 84 | public void setName(String name) { 85 | this.name = name; 86 | } 87 | 88 | public void setOverview(String overview) { 89 | this.overview = overview; 90 | } 91 | 92 | public void setParts(List parts) { 93 | this.parts = parts; 94 | } 95 | 96 | public void setPosterPath(String posterPath) { 97 | this.posterPath = posterPath; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/config/JobDepartment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.config; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 24 | import java.io.Serializable; 25 | import java.util.List; 26 | 27 | public class JobDepartment extends AbstractJsonMapping implements Serializable { 28 | 29 | private static final long serialVersionUID = 100L; 30 | // Properties 31 | @JsonProperty("department") 32 | private String department; 33 | @JsonProperty("jobs") 34 | private List jobs; 35 | 36 | public String getDepartment() { 37 | return department; 38 | } 39 | 40 | public List getJobs() { 41 | return jobs; 42 | } 43 | 44 | public void setDepartment(String department) { 45 | this.department = department; 46 | } 47 | 48 | public void setJobs(List jobs) { 49 | this.jobs = jobs; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/credits/CreditMovieBasic.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.credits; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.enumeration.MediaType; 24 | import java.io.Serializable; 25 | 26 | /** 27 | * @author stuart.boston 28 | */ 29 | public class CreditMovieBasic extends CreditBasic implements Serializable { 30 | 31 | private static final long serialVersionUID = 100L; 32 | 33 | @JsonProperty("adult") 34 | private boolean adult; 35 | @JsonProperty("original_title") 36 | private String originalTitle; 37 | @JsonProperty("release_date") 38 | private String releaseDate; 39 | @JsonProperty("title") 40 | private String title; 41 | @JsonProperty("video") 42 | private boolean video; 43 | 44 | public CreditMovieBasic() { 45 | setMediaType(MediaType.MOVIE); 46 | } 47 | 48 | public boolean isAdult() { 49 | return adult; 50 | } 51 | 52 | public void setAdult(boolean adult) { 53 | this.adult = adult; 54 | } 55 | 56 | public String getOriginalTitle() { 57 | return originalTitle; 58 | } 59 | 60 | public void setOriginalTitle(String originalTitle) { 61 | this.originalTitle = originalTitle; 62 | } 63 | 64 | public String getReleaseDate() { 65 | return releaseDate; 66 | } 67 | 68 | public void setReleaseDate(String releaseDate) { 69 | this.releaseDate = releaseDate; 70 | } 71 | 72 | public String getTitle() { 73 | return title; 74 | } 75 | 76 | public void setTitle(String title) { 77 | this.title = title; 78 | } 79 | 80 | public boolean isVideo() { 81 | return video; 82 | } 83 | 84 | public void setVideo(boolean video) { 85 | this.video = video; 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/credits/CreditTVBasic.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.credits; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.enumeration.MediaType; 24 | import java.io.Serializable; 25 | 26 | /** 27 | * @author stuart.boston 28 | */ 29 | public class CreditTVBasic extends CreditBasic implements Serializable { 30 | 31 | private static final long serialVersionUID = 100L; 32 | 33 | @JsonProperty("episode_count") 34 | private int episodeCount; 35 | @JsonProperty("first_air_date") 36 | private String firstAirDate; 37 | @JsonProperty("name") 38 | private String name; 39 | @JsonProperty("original_name") 40 | private String originalName; 41 | @JsonProperty("origin_country") 42 | private String originCountry; 43 | 44 | public CreditTVBasic() { 45 | setMediaType(MediaType.TV); 46 | } 47 | 48 | public int getEpisodeCount() { 49 | return episodeCount; 50 | } 51 | 52 | public void setEpisodeCount(int episodeCount) { 53 | this.episodeCount = episodeCount; 54 | } 55 | 56 | public String getFirstAirDate() { 57 | return firstAirDate; 58 | } 59 | 60 | public void setFirstAirDate(String firstAirDate) { 61 | this.firstAirDate = firstAirDate; 62 | } 63 | 64 | public String getName() { 65 | return name; 66 | } 67 | 68 | public void setName(String name) { 69 | this.name = name; 70 | } 71 | 72 | public String getOriginalName() { 73 | return originalName; 74 | } 75 | 76 | public void setOriginalName(String originalName) { 77 | this.originalName = originalName; 78 | } 79 | 80 | public String getOriginCountry() { 81 | return originCountry; 82 | } 83 | 84 | public void setOriginCountry(String originCountry) { 85 | this.originCountry = originCountry; 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/credits/MediaCredit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.credits; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.interfaces.Identification; 24 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 25 | import java.io.Serializable; 26 | 27 | /** 28 | * 29 | * @author Stuart.Boston 30 | */ 31 | public class MediaCredit extends AbstractJsonMapping implements Serializable, Identification { 32 | 33 | private static final long serialVersionUID = 100L; 34 | 35 | @JsonProperty("credit_id") 36 | private String creditId; 37 | @JsonProperty("id") 38 | private int id; 39 | @JsonProperty("profile_path") 40 | private String artworkPath; 41 | @JsonProperty("name") 42 | private String name; 43 | @JsonProperty("gender") 44 | private int gender; 45 | 46 | public String getCreditId() { 47 | return creditId; 48 | } 49 | 50 | public void setCreditId(String creditId) { 51 | this.creditId = creditId; 52 | } 53 | 54 | @Override 55 | public int getId() { 56 | return id; 57 | } 58 | 59 | @Override 60 | public void setId(int id) { 61 | this.id = id; 62 | } 63 | 64 | public String getArtworkPath() { 65 | return artworkPath; 66 | } 67 | 68 | public void setArtworkPath(String artworkPath) { 69 | this.artworkPath = artworkPath; 70 | } 71 | 72 | public String getName() { 73 | return name; 74 | } 75 | 76 | public void setName(String name) { 77 | this.name = name; 78 | } 79 | 80 | public int getGender() { 81 | return gender; 82 | } 83 | 84 | public void setGender(int gender) { 85 | this.gender = gender; 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/credits/MediaCreditCast.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.credits; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import java.io.Serializable; 24 | 25 | /** 26 | * 27 | * @author Stuart.Boston 28 | */ 29 | public class MediaCreditCast extends MediaCredit implements Serializable { 30 | 31 | private static final long serialVersionUID = 100L; 32 | 33 | @JsonProperty("cast_id") 34 | private int castId = 0; 35 | @JsonProperty("character") 36 | private String character; 37 | @JsonProperty("order") 38 | private int order; 39 | 40 | public int getCastId() { 41 | return castId; 42 | } 43 | 44 | public void setCastId(int castId) { 45 | this.castId = castId; 46 | } 47 | 48 | public String getCharacter() { 49 | return character; 50 | } 51 | 52 | public void setCharacter(String character) { 53 | this.character = character; 54 | } 55 | 56 | public int getOrder() { 57 | return order; 58 | } 59 | 60 | public void setOrder(int order) { 61 | this.order = order; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/credits/MediaCreditCrew.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.credits; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import java.io.Serializable; 24 | 25 | /** 26 | * 27 | * @author Stuart.Boston 28 | */ 29 | public class MediaCreditCrew extends MediaCredit implements Serializable { 30 | 31 | private static final long serialVersionUID = 100L; 32 | 33 | @JsonProperty("department") 34 | private String department; 35 | @JsonProperty("job") 36 | private String job; 37 | 38 | public String getDepartment() { 39 | return department; 40 | } 41 | 42 | public void setDepartment(String department) { 43 | this.department = department; 44 | } 45 | 46 | public String getJob() { 47 | return job; 48 | } 49 | 50 | public void setJob(String job) { 51 | this.job = job; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/discover/WithBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.discover; 21 | 22 | /** 23 | * Class to create a String for the "with???" parameters of the Discover method 24 | * 25 | * @author Stuart 26 | */ 27 | public class WithBuilder { 28 | 29 | StringBuilder value = new StringBuilder(); 30 | 31 | /** 32 | * Create the first ID in the string 33 | * 34 | * @param id 35 | */ 36 | public WithBuilder(int id) { 37 | value.append(id); 38 | } 39 | 40 | /** 41 | * Create the first ID in the string 42 | * 43 | * @param id 44 | */ 45 | public WithBuilder(String id) { 46 | value.append(id); 47 | } 48 | 49 | /** 50 | * Generate the string to pass to the method 51 | * 52 | * @return 53 | */ 54 | public String build() { 55 | return value.toString(); 56 | } 57 | 58 | /** 59 | * Generate the string to pass to the method 60 | * 61 | * @return 62 | */ 63 | @Override 64 | public String toString() { 65 | return build(); 66 | } 67 | 68 | /** 69 | * Add an "AND ID" 70 | * 71 | * @param id 72 | * @return 73 | */ 74 | public WithBuilder and(int id) { 75 | value.append(",").append(id); 76 | return this; 77 | } 78 | 79 | /** 80 | * Add an "AND ID" 81 | * 82 | * @param id 83 | * @return 84 | */ 85 | public WithBuilder and(String id) { 86 | value.append(",").append(id); 87 | return this; 88 | } 89 | 90 | /** 91 | * Add an "OR ID" 92 | * 93 | * @param id 94 | * @return 95 | */ 96 | public WithBuilder or(int id) { 97 | value.append("|").append(id); 98 | return this; 99 | } 100 | 101 | /** 102 | * Add an "OR ID" 103 | * 104 | * @param id 105 | * @return 106 | */ 107 | public WithBuilder or(String id) { 108 | value.append("|").append(id); 109 | return this; 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/keyword/Keyword.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.keyword; 21 | 22 | import com.fasterxml.jackson.annotation.JsonRootName; 23 | import com.omertron.themoviedbapi.model.AbstractIdName; 24 | import java.io.Serializable; 25 | 26 | /** 27 | * @author stuart.boston 28 | */ 29 | @JsonRootName("keyword") 30 | public class Keyword extends AbstractIdName implements Serializable { 31 | 32 | private static final long serialVersionUID = 100L; 33 | // Nothing to override from the base class. 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/list/ListItemStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.list; 21 | 22 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 23 | import com.fasterxml.jackson.annotation.JsonProperty; 24 | 25 | /** 26 | * @author Holger Brandl 27 | */ 28 | public class ListItemStatus extends AbstractJsonMapping { 29 | 30 | private static final long serialVersionUID = 101L; 31 | 32 | @JsonProperty("id") 33 | private String id; 34 | @JsonProperty("status_code") 35 | private int statusCode; 36 | @JsonProperty("item_present") 37 | private boolean itemPresent; 38 | 39 | public String getId() { 40 | return id; 41 | } 42 | 43 | public void setId(String id) { 44 | this.id = id; 45 | } 46 | 47 | public int getStatusCode() { 48 | return statusCode; 49 | } 50 | 51 | public void setStatusCode(int statusCode) { 52 | this.statusCode = statusCode; 53 | } 54 | 55 | public boolean isItemPresent() { 56 | return itemPresent; 57 | } 58 | 59 | public void setItemPresent(boolean itemPresent) { 60 | this.itemPresent = itemPresent; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/list/ListStatusCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation;private either version 3 of the License;private or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful;private 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not;private see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.list; 21 | 22 | import com.omertron.themoviedbapi.model.StatusCode; 23 | import com.fasterxml.jackson.annotation.JsonProperty; 24 | 25 | public class ListStatusCode extends StatusCode { 26 | 27 | @JsonProperty("list_id") 28 | private String listId; 29 | @JsonProperty("success") 30 | private boolean success; 31 | 32 | public String getListId() { 33 | return listId; 34 | } 35 | 36 | public void setListId(String listId) { 37 | this.listId = listId; 38 | } 39 | 40 | public boolean isSuccess() { 41 | return success; 42 | } 43 | 44 | public void setSuccess(boolean success) { 45 | this.success = success; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/media/AlternativeTitle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.media; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import java.io.Serializable; 24 | import org.apache.commons.lang3.builder.EqualsBuilder; 25 | import org.apache.commons.lang3.builder.HashCodeBuilder; 26 | 27 | /** 28 | * @author Stuart 29 | */ 30 | public class AlternativeTitle implements Serializable { 31 | 32 | private static final long serialVersionUID = 100L; 33 | 34 | @JsonProperty("iso_3166_1") 35 | private String country; 36 | @JsonProperty("title") 37 | private String title; 38 | @JsonProperty("type") 39 | private String type; 40 | 41 | public String getCountry() { 42 | return country; 43 | } 44 | 45 | public String getTitle() { 46 | return title; 47 | } 48 | 49 | public void setCountry(String country) { 50 | this.country = country; 51 | } 52 | 53 | public void setTitle(String title) { 54 | this.title = title; 55 | } 56 | 57 | public String getType() { 58 | return type; 59 | } 60 | 61 | public void setType(String type) { 62 | this.type = type; 63 | } 64 | 65 | @Override 66 | public boolean equals(Object obj) { 67 | if (obj instanceof AlternativeTitle) { 68 | final AlternativeTitle other = (AlternativeTitle) obj; 69 | return new EqualsBuilder() 70 | .append(country, other.country) 71 | .append(title, other.title) 72 | .append(type, other.type) 73 | .isEquals(); 74 | } else { 75 | return false; 76 | } 77 | } 78 | 79 | @Override 80 | public int hashCode() { 81 | return new HashCodeBuilder() 82 | .append(country) 83 | .append(title) 84 | .append(type) 85 | .toHashCode(); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/media/MediaCreditList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.media; 21 | 22 | import com.omertron.themoviedbapi.model.credits.MediaCreditCrew; 23 | import com.omertron.themoviedbapi.model.credits.MediaCreditCast; 24 | import com.fasterxml.jackson.annotation.JsonProperty; 25 | import com.omertron.themoviedbapi.interfaces.Identification; 26 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 27 | import java.io.Serializable; 28 | import java.util.Collections; 29 | import java.util.List; 30 | 31 | /** 32 | * @author stuart.boston 33 | */ 34 | public class MediaCreditList extends AbstractJsonMapping implements Serializable, Identification { 35 | 36 | private static final long serialVersionUID = 100L; 37 | 38 | @JsonProperty("id") 39 | private int id = 0; 40 | @JsonProperty("cast") 41 | private List cast = Collections.emptyList(); 42 | @JsonProperty("guest_stars") 43 | private List guestStars = Collections.emptyList(); 44 | @JsonProperty("crew") 45 | private List crew = Collections.emptyList(); 46 | 47 | @Override 48 | public int getId() { 49 | return id; 50 | } 51 | 52 | @Override 53 | public void setId(int id) { 54 | this.id = id; 55 | } 56 | 57 | public List getCast() { 58 | return cast; 59 | } 60 | 61 | public void setCast(List cast) { 62 | this.cast = cast; 63 | } 64 | 65 | public List getCrew() { 66 | return crew; 67 | } 68 | 69 | public void setCrew(List crew) { 70 | this.crew = crew; 71 | } 72 | 73 | public List getGuestStars() { 74 | return guestStars; 75 | } 76 | 77 | public void setGuestStars(List guestStars) { 78 | this.guestStars = guestStars; 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/media/MediaState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.media; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.fasterxml.jackson.annotation.JsonSetter; 24 | import com.omertron.themoviedbapi.interfaces.Identification; 25 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 26 | import java.io.Serializable; 27 | 28 | /** 29 | * 30 | * @author Stuart.Boston 31 | */ 32 | public class MediaState extends AbstractJsonMapping implements Serializable, Identification { 33 | 34 | private static final long serialVersionUID = 100L; 35 | 36 | @JsonProperty("id") 37 | private int id; 38 | @JsonProperty("favorite") 39 | private boolean favorite; 40 | @JsonProperty("watchlist") 41 | private boolean watchlist; 42 | private float rated; 43 | 44 | @Override 45 | public int getId() { 46 | return id; 47 | } 48 | 49 | @Override 50 | public void setId(int id) { 51 | this.id = id; 52 | } 53 | 54 | public boolean isFavorite() { 55 | return favorite; 56 | } 57 | 58 | public void setFavorite(boolean favorite) { 59 | this.favorite = favorite; 60 | } 61 | 62 | public boolean isWatchlist() { 63 | return watchlist; 64 | } 65 | 66 | public void setWatchlist(boolean watchlist) { 67 | this.watchlist = watchlist; 68 | } 69 | 70 | public float getRated() { 71 | return rated; 72 | } 73 | 74 | @JsonSetter("rated") 75 | public void setRated(RatedValue rated) { 76 | this.rated = rated.getValue(); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/media/RatedValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.media; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 24 | import java.io.Serializable; 25 | 26 | /** 27 | * 28 | * @author Stuart.Boston 29 | */ 30 | public class RatedValue extends AbstractJsonMapping implements Serializable { 31 | 32 | private static final long serialVersionUID = 100L; 33 | 34 | @JsonProperty("value") 35 | private float value = -1f; 36 | 37 | public float getValue() { 38 | return value; 39 | } 40 | 41 | public void setValue(float value) { 42 | this.value = value; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/movie/ProductionCompany.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.movie; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.fasterxml.jackson.annotation.JsonRootName; 24 | import com.omertron.themoviedbapi.model.AbstractIdName; 25 | import java.io.Serializable; 26 | 27 | /** 28 | * @author stuart.boston 29 | */ 30 | @JsonRootName("production_company") 31 | public class ProductionCompany extends AbstractIdName implements Serializable { 32 | 33 | private static final long serialVersionUID = 100L; 34 | @JsonProperty("logo_path") 35 | private String logoPath; 36 | @JsonProperty("origin_country") 37 | private String originCountry; 38 | 39 | public String getLogoPath() { 40 | return logoPath; 41 | } 42 | 43 | public void setLogoPath(String logoPath) { 44 | this.logoPath = logoPath; 45 | } 46 | 47 | public String getOriginCountry() { 48 | return originCountry; 49 | } 50 | 51 | public void setOriginCountry(String originCountry) { 52 | this.originCountry = originCountry; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/movie/ProductionCountry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.movie; 21 | 22 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 23 | import com.fasterxml.jackson.annotation.JsonProperty; 24 | import com.fasterxml.jackson.annotation.JsonRootName; 25 | import java.io.Serializable; 26 | import org.apache.commons.lang3.builder.EqualsBuilder; 27 | import org.apache.commons.lang3.builder.HashCodeBuilder; 28 | 29 | /** 30 | * @author stuart.boston 31 | */ 32 | @JsonRootName("production_country") 33 | public class ProductionCountry extends AbstractJsonMapping implements Serializable { 34 | 35 | private static final long serialVersionUID = 100L; 36 | 37 | @JsonProperty("iso_3166_1") 38 | private String country; 39 | @JsonProperty("name") 40 | private String name; 41 | 42 | public String getCountry() { 43 | return country; 44 | } 45 | 46 | public void setCountry(String country) { 47 | this.country = country; 48 | } 49 | 50 | public String getName() { 51 | return name; 52 | } 53 | 54 | public void setName(String name) { 55 | this.name = name; 56 | } 57 | 58 | @Override 59 | public boolean equals(Object obj) { 60 | if (obj instanceof ProductionCountry) { 61 | final ProductionCountry other = (ProductionCountry) obj; 62 | return new EqualsBuilder() 63 | .append(name, other.name) 64 | .append(country, other.country) 65 | .isEquals(); 66 | } else { 67 | return false; 68 | } 69 | } 70 | 71 | @Override 72 | public int hashCode() { 73 | return new HashCodeBuilder() 74 | .append(country) 75 | .append(name) 76 | .toHashCode(); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/movie/Release.java: -------------------------------------------------------------------------------- 1 | package com.omertron.themoviedbapi.model.movie; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 5 | 6 | public class Release extends AbstractJsonMapping { 7 | 8 | @JsonProperty("certification") 9 | private String certification; 10 | @JsonProperty("release_date") 11 | private String releaseDate; 12 | 13 | public String getCertification() { 14 | return certification; 15 | } 16 | 17 | public void setCertification(String certification) { 18 | this.certification = certification; 19 | } 20 | 21 | public String getReleaseDate() { 22 | return releaseDate; 23 | } 24 | 25 | public void setReleaseDate(String releaseDate) { 26 | this.releaseDate = releaseDate; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/movie/ReleaseDate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.movie; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.fasterxml.jackson.annotation.JsonSetter; 24 | import com.omertron.themoviedbapi.enumeration.ReleaseType; 25 | 26 | public class ReleaseDate extends Release { 27 | 28 | private static final long serialVersionUID = 100L; 29 | 30 | @JsonProperty("note") 31 | private String note; 32 | @JsonProperty("iso_639_1") 33 | private String language; 34 | private ReleaseType releaseType; 35 | 36 | public String getNote() { 37 | return note; 38 | } 39 | 40 | public void setNote(String note) { 41 | this.note = note; 42 | } 43 | 44 | public String getLanguage() { 45 | return language; 46 | } 47 | 48 | public void setLanguage(String language) { 49 | this.language = language; 50 | } 51 | 52 | public ReleaseType getType() { 53 | return releaseType; 54 | } 55 | 56 | @JsonSetter("type") 57 | public void setType(int type) { 58 | this.releaseType = ReleaseType.fromInteger(type); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/movie/ReleaseDates.java: -------------------------------------------------------------------------------- 1 | package com.omertron.themoviedbapi.model.movie; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 5 | import java.util.List; 6 | 7 | public class ReleaseDates extends AbstractJsonMapping { 8 | 9 | @JsonProperty("iso_3166_1") 10 | private String country; 11 | @JsonProperty("release_dates") 12 | private List releaseDate; 13 | 14 | public String getCountry() { 15 | return country; 16 | } 17 | 18 | public void setCountry(String country) { 19 | this.country = country; 20 | } 21 | 22 | public List getReleaseDate() { 23 | return releaseDate; 24 | } 25 | 26 | public void setReleaseDate(List releaseDate) { 27 | this.releaseDate = releaseDate; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/movie/ReleaseInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.movie; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import java.io.Serializable; 24 | import org.apache.commons.lang3.builder.EqualsBuilder; 25 | import org.apache.commons.lang3.builder.HashCodeBuilder; 26 | 27 | /** 28 | * @author Stuart 29 | */ 30 | public class ReleaseInfo extends Release implements Serializable { 31 | 32 | private static final long serialVersionUID = 100L; 33 | 34 | @JsonProperty("iso_3166_1") 35 | private String country; 36 | @JsonProperty("primary") 37 | private boolean primary; 38 | 39 | public String getCountry() { 40 | return country; 41 | } 42 | 43 | public void setCountry(String country) { 44 | this.country = country; 45 | } 46 | 47 | public boolean isPrimary() { 48 | return primary; 49 | } 50 | 51 | public void setPrimary(boolean primary) { 52 | this.primary = primary; 53 | } 54 | 55 | @Override 56 | public boolean equals(Object obj) { 57 | if (obj instanceof ReleaseInfo) { 58 | final ReleaseInfo other = (ReleaseInfo) obj; 59 | return new EqualsBuilder() 60 | .append(getCountry(), other.getCountry()) 61 | .append(getCertification(), other.getCertification()) 62 | .append(getReleaseDate(), other.getReleaseDate()) 63 | .append(primary, other.primary) 64 | .isEquals(); 65 | } else { 66 | return false; 67 | } 68 | } 69 | 70 | @Override 71 | public int hashCode() { 72 | return new HashCodeBuilder() 73 | .append(getCountry()) 74 | .append(getCertification()) 75 | .append(getReleaseDate()) 76 | .append(primary) 77 | .toHashCode(); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/network/Network.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.network; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.interfaces.Identification; 24 | import com.omertron.themoviedbapi.model.AbstractIdName; 25 | import java.io.Serializable; 26 | 27 | /** 28 | * @author stuart.boston 29 | */ 30 | public class Network extends AbstractIdName implements Serializable, Identification { 31 | 32 | private static final long serialVersionUID = 100L; 33 | // Nothing to add to base class 34 | @JsonProperty("headquarters") 35 | private String headquarters; 36 | @JsonProperty("homepage") 37 | private String homepage; 38 | @JsonProperty("origin_country") 39 | private String originCountry; 40 | @JsonProperty("logo_path") 41 | private String logoPath; 42 | 43 | public String getHeadquarters() { 44 | return headquarters; 45 | } 46 | 47 | public void setHeadquarters(String headquarters) { 48 | this.headquarters = headquarters; 49 | } 50 | 51 | public String getHomepage() { 52 | return homepage; 53 | } 54 | 55 | public void setHomepage(String homepage) { 56 | this.homepage = homepage; 57 | } 58 | 59 | public String getOriginCountry() { 60 | return originCountry; 61 | } 62 | 63 | public void setOriginCountry(String originCountry) { 64 | this.originCountry = originCountry; 65 | } 66 | 67 | public String getLogoPath() { 68 | return logoPath; 69 | } 70 | 71 | public void setLogoPath(String logoPath) { 72 | this.logoPath = logoPath; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/person/ContentRating.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.person; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import java.io.Serializable; 24 | 25 | /** 26 | * 27 | * @author Stuart.Boston 28 | */ 29 | public class ContentRating implements Serializable { 30 | 31 | private static final long serialVersionUID = 100L; 32 | 33 | @JsonProperty("iso_3166_1") 34 | private String country; 35 | @JsonProperty("rating") 36 | private String rating; 37 | 38 | public String getCountry() { 39 | return country; 40 | } 41 | 42 | public void setCountry(String country) { 43 | this.country = country; 44 | } 45 | 46 | public String getRating() { 47 | return rating; 48 | } 49 | 50 | public void setRating(String rating) { 51 | this.rating = rating; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/person/CreditInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.person; 21 | 22 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 23 | import com.fasterxml.jackson.annotation.JsonProperty; 24 | import com.omertron.themoviedbapi.model.tv.TVCredit; 25 | import java.io.Serializable; 26 | 27 | /** 28 | * @author stuart.boston 29 | */ 30 | public class CreditInfo extends AbstractJsonMapping implements Serializable { 31 | 32 | private static final long serialVersionUID = 100L; 33 | 34 | @JsonProperty("id") 35 | private String id; 36 | @JsonProperty("credit_type") 37 | private String creditType; 38 | @JsonProperty("department") 39 | private String department; 40 | @JsonProperty("job") 41 | private String job; 42 | @JsonProperty("media_type") 43 | private String mediaType; 44 | @JsonProperty("person") 45 | private PersonBasic person; 46 | @JsonProperty("media") 47 | private TVCredit media; 48 | 49 | public String getId() { 50 | return id; 51 | } 52 | 53 | public void setId(String id) { 54 | this.id = id; 55 | } 56 | 57 | public String getCreditType() { 58 | return creditType; 59 | } 60 | 61 | public void setCreditType(String creditType) { 62 | this.creditType = creditType; 63 | } 64 | 65 | public String getDepartment() { 66 | return department; 67 | } 68 | 69 | public void setDepartment(String department) { 70 | this.department = department; 71 | } 72 | 73 | public String getJob() { 74 | return job; 75 | } 76 | 77 | public void setJob(String job) { 78 | this.job = job; 79 | } 80 | 81 | public String getMediaType() { 82 | return mediaType; 83 | } 84 | 85 | public void setMediaType(String mediaType) { 86 | this.mediaType = mediaType; 87 | } 88 | 89 | public PersonBasic getPerson() { 90 | return person; 91 | } 92 | 93 | public void setPerson(PersonBasic person) { 94 | this.person = person; 95 | } 96 | 97 | public TVCredit getMedia() { 98 | return media; 99 | } 100 | 101 | public void setMedia(TVCredit media) { 102 | this.media = media; 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/person/PersonBasic.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.person; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.fasterxml.jackson.annotation.JsonSetter; 24 | import com.omertron.themoviedbapi.enumeration.Gender; 25 | import com.omertron.themoviedbapi.model.AbstractIdName; 26 | import java.io.Serializable; 27 | 28 | /** 29 | * @author stuart.boston 30 | */ 31 | public class PersonBasic extends AbstractIdName implements Serializable { 32 | 33 | private static final long serialVersionUID = 100L; 34 | 35 | @JsonProperty("profile_path") 36 | private String profilePath; 37 | @JsonProperty("gender") 38 | private Gender gender; 39 | 40 | public String getProfilePath() { 41 | return profilePath; 42 | } 43 | 44 | public void setProfilePath(String profilePath) { 45 | this.profilePath = profilePath; 46 | } 47 | 48 | public Gender getGender() { 49 | return gender; 50 | } 51 | 52 | @JsonSetter("gender") 53 | public void setGender(int gender) { 54 | this.gender = Gender.fromInteger(gender); 55 | } 56 | 57 | public void setGender(Gender gender) { 58 | this.gender = gender; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/person/PersonCreditList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.person; 21 | 22 | import com.omertron.themoviedbapi.model.credits.CreditBasic; 23 | import com.fasterxml.jackson.annotation.JsonProperty; 24 | import com.fasterxml.jackson.annotation.JsonSetter; 25 | import com.omertron.themoviedbapi.interfaces.Identification; 26 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 27 | import java.util.List; 28 | 29 | /** 30 | * @author stuart.boston 31 | * @param 32 | */ 33 | public class PersonCreditList extends AbstractJsonMapping implements Identification { 34 | 35 | private static final long serialVersionUID = 101L; 36 | 37 | @JsonProperty("id") 38 | private int id; 39 | private List cast; 40 | private List crew; 41 | 42 | @Override 43 | public int getId() { 44 | return id; 45 | } 46 | 47 | @Override 48 | public void setId(int id) { 49 | this.id = id; 50 | } 51 | 52 | public List getCast() { 53 | return cast; 54 | } 55 | 56 | @JsonSetter("cast") 57 | public void setCast(List cast) { 58 | this.cast = cast; 59 | } 60 | 61 | public List getCrew() { 62 | return crew; 63 | } 64 | 65 | @JsonSetter("crew") 66 | public void setCrew(List crew) { 67 | this.crew = crew; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/person/PersonCreditsMixIn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.person; 21 | 22 | import com.omertron.themoviedbapi.model.credits.CreditBasic; 23 | import com.omertron.themoviedbapi.model.credits.CreditTVBasic; 24 | import com.omertron.themoviedbapi.model.credits.CreditMovieBasic; 25 | import com.fasterxml.jackson.annotation.JsonSetter; 26 | import com.fasterxml.jackson.annotation.JsonSubTypes; 27 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 28 | import java.util.List; 29 | 30 | /** 31 | * Jackson mixin class to deserialize the combined credits 32 | * 33 | * @author Stuart.Boston 34 | */ 35 | public class PersonCreditsMixIn { 36 | 37 | @JsonTypeInfo( 38 | use = JsonTypeInfo.Id.NAME, 39 | include = JsonTypeInfo.As.PROPERTY, 40 | property = "media_type", 41 | defaultImpl = CreditBasic.class 42 | ) 43 | @JsonSubTypes({ 44 | @JsonSubTypes.Type(value = CreditMovieBasic.class, name = "movie"), 45 | @JsonSubTypes.Type(value = CreditTVBasic.class, name = "tv") 46 | }) 47 | @JsonSetter("cast") 48 | public void setCast(List cast) { 49 | // Mixin empty class 50 | } 51 | 52 | @JsonTypeInfo( 53 | use = JsonTypeInfo.Id.NAME, 54 | include = JsonTypeInfo.As.PROPERTY, 55 | property = "media_type", 56 | defaultImpl = CreditBasic.class 57 | ) 58 | @JsonSubTypes({ 59 | @JsonSubTypes.Type(value = CreditMovieBasic.class, name = "movie"), 60 | @JsonSubTypes.Type(value = CreditTVBasic.class, name = "tv") 61 | }) 62 | @JsonSetter("crew") 63 | public void setCrew(List crew) { 64 | // Mixin empty class 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/model/tv/TVCredit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.model.tv; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.AbstractIdName; 24 | import java.io.Serializable; 25 | import java.util.List; 26 | 27 | /** 28 | * TV Favorite information 29 | * 30 | * @author stuart.boston 31 | */ 32 | public class TVCredit extends AbstractIdName implements Serializable { 33 | 34 | private static final long serialVersionUID = 100L; 35 | 36 | @JsonProperty("original_name") 37 | private String originalName; 38 | @JsonProperty("character") 39 | private String character; 40 | @JsonProperty("seasons") 41 | private List seasons; 42 | @JsonProperty("episodes") 43 | private List episodes; 44 | 45 | public String getOriginalName() { 46 | return originalName; 47 | } 48 | 49 | public void setOriginalName(String originalName) { 50 | this.originalName = originalName; 51 | } 52 | 53 | public String getCharacter() { 54 | return character; 55 | } 56 | 57 | public void setCharacter(String character) { 58 | this.character = character; 59 | } 60 | 61 | public List getSeasons() { 62 | return seasons; 63 | } 64 | 65 | public void setSeasons(List seasons) { 66 | this.seasons = seasons; 67 | } 68 | 69 | public List getEpisodes() { 70 | return episodes; 71 | } 72 | 73 | public void setEpisodes(List episodes) { 74 | this.episodes = episodes; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/AbstractWrapperAll.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.omertron.themoviedbapi.interfaces.WrapperDates; 23 | import com.omertron.themoviedbapi.interfaces.WrapperPages; 24 | import com.omertron.themoviedbapi.interfaces.Identification; 25 | import com.fasterxml.jackson.annotation.JsonProperty; 26 | 27 | /** 28 | * Base class for the wrappers 29 | * 30 | * @author Stuart 31 | */ 32 | public class AbstractWrapperAll extends AbstractWrapperIdPages implements Identification, WrapperPages, WrapperDates { 33 | 34 | @JsonProperty("dates") 35 | private ResultDates dates = new ResultDates(); 36 | 37 | @Override 38 | public ResultDates getDates() { 39 | return dates; 40 | } 41 | 42 | @Override 43 | public void setDates(ResultDates dates) { 44 | this.dates = dates; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/AbstractWrapperBase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 23 | import java.util.ArrayList; 24 | import java.util.Arrays; 25 | import java.util.EnumSet; 26 | import java.util.List; 27 | 28 | public abstract class AbstractWrapperBase extends AbstractJsonMapping { 29 | 30 | /** 31 | * Get a list of the enums passed 32 | * 33 | * @param 34 | * @param clz Class of the enum 35 | * @param typeList Array of the enums 36 | * @return 37 | */ 38 | public > List getTypeList(Class clz, E[] typeList) { 39 | if (typeList.length > 0) { 40 | return new ArrayList<>(Arrays.asList(typeList)); 41 | } else { 42 | return new ArrayList<>(EnumSet.allOf(clz)); 43 | } 44 | } 45 | 46 | /** 47 | * Copy the wrapper values to the results 48 | * 49 | * @param results 50 | */ 51 | public void setResultProperties(AbstractWrapperIdPages results) { 52 | // There are no values to copy 53 | results.setId(0); 54 | results.setPage(0); 55 | results.setTotalPages(0); 56 | results.setTotalResults(0); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/AbstractWrapperId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.omertron.themoviedbapi.interfaces.Identification; 23 | import com.fasterxml.jackson.annotation.JsonProperty; 24 | 25 | /** 26 | * Base class for the wrappers 27 | * 28 | * @author Stuart 29 | */ 30 | public class AbstractWrapperId extends AbstractWrapperBase implements Identification { 31 | 32 | @JsonProperty("id") 33 | private int id; 34 | 35 | @Override 36 | public int getId() { 37 | return id; 38 | } 39 | 40 | @Override 41 | public void setId(int id) { 42 | this.id = id; 43 | } 44 | 45 | /** 46 | * Copy the wrapper values to the results 47 | * 48 | * @param results 49 | */ 50 | @Override 51 | public void setResultProperties(AbstractWrapperIdPages results) { 52 | super.setResultProperties(results); 53 | results.setId(id); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/AbstractWrapperIdPages.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.interfaces.WrapperPages; 24 | 25 | /** 26 | * Abstract class to return the results and the id/page info 27 | * 28 | * @author Stuart 29 | */ 30 | public abstract class AbstractWrapperIdPages extends AbstractWrapperId implements WrapperPages { 31 | 32 | @JsonProperty("page") 33 | private int page = 0; 34 | @JsonProperty("total_pages") 35 | private int totalPages = 0; 36 | @JsonProperty("total_results") 37 | private int totalResults = 0; 38 | 39 | @Override 40 | public int getPage() { 41 | return page; 42 | } 43 | 44 | @Override 45 | public int getTotalPages() { 46 | return totalPages; 47 | } 48 | 49 | @Override 50 | public int getTotalResults() { 51 | return totalResults; 52 | } 53 | 54 | @Override 55 | public void setPage(int page) { 56 | this.page = page; 57 | } 58 | 59 | @Override 60 | public void setTotalPages(int totalPages) { 61 | this.totalPages = totalPages; 62 | } 63 | 64 | @Override 65 | public void setTotalResults(int totalResults) { 66 | this.totalResults = totalResults; 67 | } 68 | 69 | /** 70 | * Copy the wrapper values to the results 71 | * 72 | * @param results 73 | */ 74 | @Override 75 | public void setResultProperties(AbstractWrapperIdPages results) { 76 | super.setResultProperties(results); 77 | results.setPage(page); 78 | results.setTotalPages(totalPages); 79 | results.setTotalResults(totalResults); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/ResultDates.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.AbstractJsonMapping; 24 | 25 | /** 26 | * 27 | * @author Stuart 28 | */ 29 | public class ResultDates extends AbstractJsonMapping { 30 | 31 | @JsonProperty("minimum") 32 | private String minimum = ""; 33 | @JsonProperty("maximum") 34 | private String maximum = ""; 35 | 36 | public String getMinimum() { 37 | return minimum; 38 | } 39 | 40 | public String getMaximum() { 41 | return maximum; 42 | } 43 | 44 | public void setMinimum(String minimum) { 45 | this.minimum = minimum; 46 | } 47 | 48 | public void setMaximum(String maximum) { 49 | this.maximum = maximum; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/ResultList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | /** 26 | * List of the results from TheMovieDb 27 | * 28 | * If the original request contains, or could contain, a page of results, this wrapper is returned to indicate what page was 29 | * returned and how many are available 30 | * 31 | * @author Stuart 32 | * @param 33 | */ 34 | public final class ResultList extends AbstractWrapperIdPages { 35 | 36 | private List results; 37 | 38 | public ResultList() { 39 | this(null); 40 | } 41 | 42 | public ResultList(List resultList) { 43 | if (resultList == null) { 44 | results = new ArrayList<>(); 45 | } else { 46 | results = new ArrayList<>(resultList); 47 | } 48 | } 49 | 50 | public List getResults() { 51 | return results; 52 | } 53 | 54 | public void setResults(List results) { 55 | this.results = results; 56 | } 57 | 58 | public boolean isEmpty() { 59 | return results.isEmpty(); 60 | } 61 | 62 | @Override 63 | public int getTotalResults() { 64 | if (super.getTotalResults() == 0) { 65 | return results.size(); 66 | } else { 67 | return super.getTotalResults(); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/ResultsMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import java.util.HashMap; 23 | import java.util.Map; 24 | 25 | /** 26 | * Map of the results from TheMovieDb 27 | * 28 | * If the original request contains, or could contain, a page of results, this wrapper is returned to indicate what page was 29 | * returned and how many are available 30 | * 31 | * @author Stuart 32 | * @param 33 | * @param 34 | */ 35 | public final class ResultsMap extends AbstractWrapperIdPages { 36 | 37 | private Map results; 38 | 39 | public ResultsMap() { 40 | this(null); 41 | } 42 | 43 | public ResultsMap(Map resultsMap) { 44 | if (resultsMap == null) { 45 | results = new HashMap<>(); 46 | } else { 47 | results = new HashMap<>(resultsMap); 48 | } 49 | } 50 | 51 | public boolean isEmpty() { 52 | return results.isEmpty(); 53 | } 54 | 55 | public Map getResults() { 56 | return results; 57 | } 58 | 59 | public boolean containsKey(K key) { 60 | return results.containsKey(key); 61 | } 62 | 63 | public V get(K key) { 64 | return results.get(key); 65 | } 66 | 67 | public void put(K key, V value) { 68 | this.results.put(key, value); 69 | } 70 | 71 | public void setResults(Map results) { 72 | this.results = results; 73 | } 74 | 75 | @Override 76 | public int getTotalResults() { 77 | if (super.getTotalResults() == 0) { 78 | return results.size(); 79 | } else { 80 | return super.getTotalResults(); 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/WrapperAlternativeTitles.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.media.AlternativeTitle; 24 | import java.util.List; 25 | 26 | /** 27 | * 28 | * @author Stuart 29 | */ 30 | public class WrapperAlternativeTitles extends AbstractWrapperId { 31 | 32 | @JsonProperty("titles") 33 | private List titles; 34 | 35 | public List getTitles() { 36 | return titles; 37 | } 38 | 39 | public void setTitles(List titles) { 40 | this.titles = titles; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/WrapperChanges.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.change.ChangeKeyItem; 24 | import java.util.ArrayList; 25 | import java.util.List; 26 | 27 | public class WrapperChanges extends AbstractWrapperBase { 28 | 29 | @JsonProperty("changes") 30 | private List changedItems = new ArrayList<>(); 31 | 32 | public List getChangedItems() { 33 | return changedItems; 34 | } 35 | 36 | public void setChangedItems(List changes) { 37 | this.changedItems = changes; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/WrapperConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.config.Configuration; 24 | import java.util.Collections; 25 | import java.util.List; 26 | 27 | /** 28 | * 29 | * @author Stuart 30 | */ 31 | public class WrapperConfig extends AbstractWrapperBase { 32 | 33 | @JsonProperty("images") 34 | private Configuration tmdbConfiguration; 35 | @JsonProperty("change_keys") 36 | private List changeKeys = Collections.emptyList(); 37 | 38 | public Configuration getTmdbConfiguration() { 39 | return tmdbConfiguration; 40 | } 41 | 42 | public void setTmdbConfiguration(Configuration tmdbConfiguration) { 43 | this.tmdbConfiguration = tmdbConfiguration; 44 | } 45 | 46 | public List getChangeKeys() { 47 | return changeKeys; 48 | } 49 | 50 | public void setChangeKeys(List changeKeys) { 51 | this.changeKeys = changeKeys; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/WrapperGenericList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonCreator; 23 | import com.fasterxml.jackson.annotation.JsonProperty; 24 | import java.util.List; 25 | 26 | /** 27 | * Generic wrapper for result lists 28 | * 29 | * @author Stuart 30 | * @param 31 | */ 32 | public class WrapperGenericList extends AbstractWrapperAll { 33 | 34 | @JsonProperty("results") 35 | private List results; 36 | 37 | public List getResults() { 38 | return results; 39 | } 40 | 41 | @JsonCreator 42 | public void setResults(List results) { 43 | this.results = results; 44 | } 45 | 46 | public ResultList getResultsList() { 47 | ResultList resultsList = new ResultList<>(results); 48 | setResultProperties(resultsList); 49 | return resultsList; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/WrapperGenres.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.Genre; 24 | import java.util.List; 25 | 26 | /** 27 | * Wrapper class for the Genres searches 28 | * 29 | * @author Stuart 30 | */ 31 | public class WrapperGenres extends AbstractWrapperBase { 32 | 33 | @JsonProperty("genres") 34 | private List genres; 35 | 36 | public List getGenres() { 37 | return genres; 38 | } 39 | 40 | public void setGenres(List genres) { 41 | this.genres = genres; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/WrapperJobList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.config.JobDepartment; 24 | import java.util.List; 25 | 26 | /** 27 | * 28 | * @author Stuart 29 | */ 30 | public class WrapperJobList extends AbstractWrapperBase { 31 | 32 | @JsonProperty("jobs") 33 | private List jobs; 34 | 35 | public List getJobs() { 36 | return jobs; 37 | } 38 | 39 | public void setJobs(List jobs) { 40 | this.jobs = jobs; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/WrapperMovieKeywords.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.keyword.Keyword; 24 | import java.util.List; 25 | 26 | /** 27 | * 28 | * @author Stuart 29 | */ 30 | public class WrapperMovieKeywords extends AbstractWrapperId { 31 | 32 | @JsonProperty("keywords") 33 | private List keywords; 34 | 35 | public List getKeywords() { 36 | return keywords; 37 | } 38 | 39 | public void setKeywords(List keywords) { 40 | this.keywords = keywords; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/WrapperMultiSearch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonSetter; 23 | import com.fasterxml.jackson.annotation.JsonSubTypes; 24 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 25 | import com.omertron.themoviedbapi.model.media.MediaBasic; 26 | import com.omertron.themoviedbapi.model.movie.MovieBasic; 27 | import com.omertron.themoviedbapi.model.tv.TVBasic; 28 | import com.omertron.themoviedbapi.model.tv.TVEpisodeBasic; 29 | import java.util.List; 30 | 31 | /** 32 | * 33 | * @author stuart.boston 34 | */ 35 | public class WrapperMultiSearch extends AbstractWrapperAll { 36 | 37 | private List results; 38 | 39 | public List getResults() { 40 | return (List) results; 41 | } 42 | 43 | @JsonTypeInfo( 44 | use = JsonTypeInfo.Id.NAME, 45 | include = JsonTypeInfo.As.PROPERTY, 46 | property = "media_type", 47 | defaultImpl = MediaBasic.class 48 | ) 49 | @JsonSubTypes({ 50 | @JsonSubTypes.Type(value = MovieBasic.class, name = "movie"), 51 | @JsonSubTypes.Type(value = TVBasic.class, name = "tv"), 52 | @JsonSubTypes.Type(value = TVEpisodeBasic.class, name = "episode") 53 | }) 54 | @JsonSetter("results") 55 | public void setResults(List results) { 56 | this.results = results; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/WrapperReleaseInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.movie.ReleaseInfo; 24 | import java.util.List; 25 | 26 | /** 27 | * 28 | * @author Stuart 29 | */ 30 | public class WrapperReleaseInfo extends AbstractWrapperId { 31 | 32 | @JsonProperty("countries") 33 | private List countries; 34 | 35 | public List getCountries() { 36 | return countries; 37 | } 38 | 39 | public void setCountries(List countries) { 40 | this.countries = countries; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/WrapperTranslations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import com.omertron.themoviedbapi.model.media.Translation; 24 | import java.util.List; 25 | 26 | /** 27 | * 28 | * @author Stuart 29 | */ 30 | public class WrapperTranslations extends AbstractWrapperId { 31 | 32 | @JsonProperty("translations") 33 | private List translations; 34 | 35 | public void setTranslations(List translations) { 36 | this.translations = translations; 37 | } 38 | 39 | public List getTranslations() { 40 | return translations; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/omertron/themoviedbapi/results/WrapperVideos.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2016 Stuart Boston 3 | * 4 | * This file is part of TheMovieDB API. 5 | * 6 | * TheMovieDB API is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * any later version. 10 | * 11 | * TheMovieDB API is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with TheMovieDB API. If not, see . 18 | * 19 | */ 20 | package com.omertron.themoviedbapi.results; 21 | 22 | import com.fasterxml.jackson.annotation.JsonSetter; 23 | import com.omertron.themoviedbapi.model.media.Trailer; 24 | import com.omertron.themoviedbapi.model.media.Video; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | /** 29 | * 30 | * @author Stuart 31 | */ 32 | public class WrapperVideos extends AbstractWrapperId { 33 | 34 | private List