Added Keyword and List functions
parent
f27f6f35fe
commit
c275e71ab4
@ -0,0 +1,150 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004-2013 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.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper for the MovieDbList function
|
||||||
|
* @author stuart.boston
|
||||||
|
*/
|
||||||
|
public class MovieDbList {
|
||||||
|
/*
|
||||||
|
* Logger
|
||||||
|
*/
|
||||||
|
|
||||||
|
private static final Logger logger = Logger.getLogger(MovieDbList.class);
|
||||||
|
/*
|
||||||
|
* Properties
|
||||||
|
*/
|
||||||
|
@JsonProperty("id")
|
||||||
|
private String id;
|
||||||
|
@JsonProperty("created_by")
|
||||||
|
private String createdBy;
|
||||||
|
@JsonProperty("description")
|
||||||
|
private String description;
|
||||||
|
@JsonProperty("favorite_count")
|
||||||
|
private int favoriteCount;
|
||||||
|
@JsonProperty("items")
|
||||||
|
private List<MovieDb> items = Collections.EMPTY_LIST;
|
||||||
|
@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 getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedBy() {
|
||||||
|
return createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFavoriteCount() {
|
||||||
|
return favoriteCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MovieDb> getItems() {
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedBy(String createdBy) {
|
||||||
|
this.createdBy = createdBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFavoriteCount(int favoriteCount) {
|
||||||
|
this.favoriteCount = favoriteCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItems(List<MovieDb> items) {
|
||||||
|
this.items = items;
|
||||||
|
}
|
||||||
|
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue