From 8d2fbb8fa9215a8647d2dd452b256e7e40d22789 Mon Sep 17 00:00:00 2001 From: Stuart Boston Date: Wed, 4 Mar 2015 13:03:25 +0000 Subject: [PATCH] Remove unused wrappers #2 --- .../themoviedbapi/model/movie/MovieDb.java | 11 +++-- .../wrapper/WrapperMovieDbList.java | 39 ---------------- .../themoviedbapi/wrapper/WrapperReviews.java | 44 ------------------- 3 files changed, 5 insertions(+), 89 deletions(-) delete mode 100644 src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieDbList.java delete mode 100644 src/main/java/com/omertron/themoviedbapi/wrapper/WrapperReviews.java diff --git a/src/main/java/com/omertron/themoviedbapi/model/movie/MovieDb.java b/src/main/java/com/omertron/themoviedbapi/model/movie/MovieDb.java index a194c681a..9ee054d1a 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/movie/MovieDb.java +++ b/src/main/java/com/omertron/themoviedbapi/model/movie/MovieDb.java @@ -37,7 +37,6 @@ import com.omertron.themoviedbapi.wrapper.WrapperGenericList; import com.omertron.themoviedbapi.wrapper.WrapperImages; import com.omertron.themoviedbapi.wrapper.WrapperMovieKeywords; import com.omertron.themoviedbapi.wrapper.WrapperReleaseInfo; -import com.omertron.themoviedbapi.wrapper.WrapperReviews; import com.omertron.themoviedbapi.wrapper.WrapperTranslations; import com.omertron.themoviedbapi.wrapper.WrapperVideos; import java.util.List; @@ -118,8 +117,7 @@ public class MovieDb extends AbstractJsonMapping { @JsonProperty("translations") private WrapperTranslations translations; private List similarMovies; - @JsonProperty("reviews") - private WrapperReviews reviews; + private List reviews; private List lists; @JsonProperty("video") private Boolean video = null; @@ -378,7 +376,7 @@ public class MovieDb extends AbstractJsonMapping { } public List getReviews() { - return reviews.getReviews(); + return reviews; } // @@ -421,8 +419,9 @@ public class MovieDb extends AbstractJsonMapping { this.lists = lists.getResults(); } - public void setReviews(WrapperReviews reviews) { - this.reviews = reviews; + @JsonSetter("reviews") + public void setReviews(WrapperGenericList reviews) { + this.reviews = reviews.getResults(); } // diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieDbList.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieDbList.java deleted file mode 100644 index b15505e0c..000000000 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieDbList.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2004-2015 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.list.ListItem; -import java.util.List; - -public class WrapperMovieDbList extends AbstractWrapperAll { - - - @JsonProperty("results") - private List lists; - - public List getLists() { - return lists; - } - - public void setLists(List lists) { - this.lists = lists; - } -} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperReviews.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperReviews.java deleted file mode 100644 index d9b17f8a9..000000000 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperReviews.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2004-2015 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.review.Review; -import java.io.Serializable; -import java.util.List; - -/** - * - * @author stuart.boston - */ -public class WrapperReviews extends AbstractWrapperAll implements Serializable { - - private static final long serialVersionUID = 1L; - @JsonProperty("results") - private List reviews; - - public List getReviews() { - return reviews; - } - - public void setReviews(List reviews) { - this.reviews = reviews; - } -}