* page)
* @return
* @throws MovieDbException
*/
public TmdbResultsList<MovieDb> searchMovie(String movieName, int searchYear, String language, boolean includeAdult, int page) throws MovieDbException {
ApiUrl apiUrl = new ApiUrl(apiKey, BASE_SEARCH, "movie");
if (StringUtils.isNotBlank(movieName)) {
apiUrl.addArgument(PARAM_QUERY, movieName);
}
if (searchYear > 0) {
apiUrl.addArgument(PARAM_YEAR, Integer.toString(searchYear));
}
if (StringUtils.isNotBlank(language)) {
apiUrl.addArgument(PARAM_LANGUAGE, language);
}
apiUrl.addArgument(PARAM_ADULT, Boolean.toString(includeAdult));
if (page > 0) {
apiUrl.addArgument(PARAM_PAGE, Integer.toString(page));
}
URL url = apiUrl.buildUrl();
String webpage = requestWebPage(url);
try {
WrapperMovie wrapper = mapper.readValue(webpage, WrapperMovie.class);
TmdbResultsList<MovieDb> results = new TmdbResultsList<MovieDb>(wrapper.getMovies());