Added getMovieLists method
parent
902db42094
commit
608c0a9b05
@ -0,0 +1,137 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2012 Stuart Boston
|
||||||
|
*
|
||||||
|
* This file is part of TheMovieDB API.
|
||||||
|
*
|
||||||
|
* TheMovieDB API is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* TheMovieDB API is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.omertron.themoviedbapi.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Stuart
|
||||||
|
*/
|
||||||
|
public class MovieList implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Logger
|
||||||
|
*/
|
||||||
|
private static final Logger logger = Logger.getLogger(MovieList.class);
|
||||||
|
/*
|
||||||
|
* Properties
|
||||||
|
*/
|
||||||
|
@JsonProperty("description")
|
||||||
|
private String description;
|
||||||
|
@JsonProperty("favorite_count")
|
||||||
|
private int favoriteCount;
|
||||||
|
@JsonProperty("id")
|
||||||
|
private String id;
|
||||||
|
@JsonProperty("item_count")
|
||||||
|
private int itemCount;
|
||||||
|
@JsonProperty("iso_639_1")
|
||||||
|
private String language;
|
||||||
|
@JsonProperty("name")
|
||||||
|
private String name;
|
||||||
|
@JsonProperty("poster_path")
|
||||||
|
private String posterPath;
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Getter methods">
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFavoriteCount() {
|
||||||
|
return favoriteCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getItemCount() {
|
||||||
|
return itemCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLanguage() {
|
||||||
|
return language;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPosterPath() {
|
||||||
|
return posterPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
// </editor-fold>
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Setter methods">
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFavoriteCount(int favoriteCount) {
|
||||||
|
this.favoriteCount = favoriteCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemCount(int itemCount) {
|
||||||
|
this.itemCount = itemCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLanguage(String language) {
|
||||||
|
this.language = language;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPosterPath(String posterPath) {
|
||||||
|
this.posterPath = posterPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
// </editor-fold>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle unknown properties and print a message
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
|
@JsonAnySetter
|
||||||
|
public void handleUnknown(String key, Object value) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("Unknown property: '").append(key);
|
||||||
|
sb.append("' value: '").append(value).append("'");
|
||||||
|
logger.trace(sb.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "MovieList{" + "description=" + description + ", favoriteCount=" + favoriteCount + ", id=" + id + ", itemCount=" + itemCount + ", language=" + language + ", name=" + name + ", posterPath=" + posterPath + '}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,110 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2012 Stuart Boston
|
||||||
|
*
|
||||||
|
* This file is part of TheMovieDB API.
|
||||||
|
*
|
||||||
|
* TheMovieDB API is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* TheMovieDB API is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.omertron.themoviedbapi.wrapper;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.omertron.themoviedbapi.model.AlternativeTitle;
|
||||||
|
import com.omertron.themoviedbapi.model.MovieList;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Stuart
|
||||||
|
*/
|
||||||
|
public class WrapperMovieList {
|
||||||
|
/*
|
||||||
|
* Logger
|
||||||
|
*/
|
||||||
|
|
||||||
|
private static final Logger logger = Logger.getLogger(WrapperMovieList.class);
|
||||||
|
/*
|
||||||
|
* Properties
|
||||||
|
*/
|
||||||
|
@JsonProperty("id")
|
||||||
|
private int id;
|
||||||
|
@JsonProperty("page")
|
||||||
|
private int page;
|
||||||
|
@JsonProperty("results")
|
||||||
|
private List<MovieList> movieList;
|
||||||
|
@JsonProperty("total_pages")
|
||||||
|
private int totalPages;
|
||||||
|
@JsonProperty("total_results")
|
||||||
|
private int totalResults;
|
||||||
|
|
||||||
|
//<editor-fold defaultstate="collapsed" desc="Getter Methods">
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPage() {
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MovieList> getMovieList() {
|
||||||
|
return movieList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalPages() {
|
||||||
|
return totalPages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalResults() {
|
||||||
|
return totalResults;
|
||||||
|
}
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
|
//<editor-fold defaultstate="collapsed" desc="Setter Methods">
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPage(int page) {
|
||||||
|
this.page = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMovieList(List<MovieList> movieList) {
|
||||||
|
this.movieList = movieList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalPages(int totalPages) {
|
||||||
|
this.totalPages = totalPages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalResults(int totalResults) {
|
||||||
|
this.totalResults = totalResults;
|
||||||
|
}
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle unknown properties and print a message
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
|
@JsonAnySetter
|
||||||
|
public void handleUnknown(String key, Object value) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("Unknown property: '").append(key);
|
||||||
|
sb.append("' value: '").append(value).append("'");
|
||||||
|
logger.trace(sb.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue