diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/AbstractWrapper.java b/src/main/java/com/omertron/themoviedbapi/wrapper/AbstractWrapper.java new file mode 100644 index 000000000..e55c69c4a --- /dev/null +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/AbstractWrapper.java @@ -0,0 +1,47 @@ +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AbstractWrapper { + + private Logger log; + + public AbstractWrapper(Class classToLog) { + this.log = LoggerFactory.getLogger(classToLog); + } + + /** + * 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("'"); + log.trace(sb.toString()); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperBase.java b/src/main/java/com/omertron/themoviedbapi/wrapper/AbstractWrapperAll.java similarity index 60% rename from src/main/java/com/omertron/themoviedbapi/wrapper/WrapperBase.java rename to src/main/java/com/omertron/themoviedbapi/wrapper/AbstractWrapperAll.java index 196dd7efa..e05281a6d 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperBase.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/AbstractWrapperAll.java @@ -1,102 +1,74 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.slf4j.Logger; - -/** - * Base class for the wrappers - * - * @author Stuart - */ -public class WrapperBase { - /* - * Logger - set by the sub-classes - */ - - private Logger log; - /* - * Properties - */ - @JsonProperty("id") - private int id; - @JsonProperty("page") - private int page; - @JsonProperty("total_pages") - private int totalPages; - @JsonProperty("total_results") - private int totalResults; - - public WrapperBase(Logger logger) { - this.log = logger; - } - - // - public int getId() { - return id; - } - - public int getPage() { - return page; - } - - public int getTotalPages() { - return totalPages; - } - - public int getTotalResults() { - return totalResults; - } - // - - // - public void setId(int id) { - this.id = id; - } - - public void setPage(int page) { - this.page = page; - } - - public void setTotalPages(int totalPages) { - this.totalPages = totalPages; - } - - public void setTotalResults(int totalResults) { - this.totalResults = totalResults; - } - // - - /** - * 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("'"); - log.trace(sb.toString()); - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for the wrappers + * + * @author Stuart + */ +public class AbstractWrapperAll extends AbstractWrapperId implements IWrapperId, IWrapperPages { + /* + * Properties + */ + + @JsonProperty("page") + private int page; + @JsonProperty("total_pages") + private int totalPages; + @JsonProperty("total_results") + private int totalResults; + + public AbstractWrapperAll(Class classToLog) { + super(classToLog); + } + + @Override + public int getPage() { + return page; + } + + @Override + public int getTotalPages() { + return totalPages; + } + + @Override + public int getTotalResults() { + return totalResults; + } + + @Override + public void setPage(int page) { + this.page = page; + } + + @Override + public void setTotalPages(int totalPages) { + this.totalPages = totalPages; + } + + @Override + public void setTotalResults(int totalResults) { + this.totalResults = totalResults; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/AbstractWrapperId.java b/src/main/java/com/omertron/themoviedbapi/wrapper/AbstractWrapperId.java new file mode 100644 index 000000000..5e07ae62c --- /dev/null +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/AbstractWrapperId.java @@ -0,0 +1,50 @@ +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for the wrappers + * + * @author Stuart + */ +public class AbstractWrapperId extends AbstractWrapper implements IWrapperId { + /* + * Properties + */ + @JsonProperty("id") + private int id; + + public AbstractWrapperId(Class classToLog) { + super(classToLog); + } + + @Override + public int getId() { + return id; + } + + @Override + public void setId(int id) { + this.id = id; + } + +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/IWrapperId.java b/src/main/java/com/omertron/themoviedbapi/wrapper/IWrapperId.java new file mode 100644 index 000000000..a00942f35 --- /dev/null +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/IWrapperId.java @@ -0,0 +1,27 @@ +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +public interface IWrapperId { + + int getId(); + + void setId(int id); +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/IWrapperPages.java b/src/main/java/com/omertron/themoviedbapi/wrapper/IWrapperPages.java new file mode 100644 index 000000000..fa53bfe8f --- /dev/null +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/IWrapperPages.java @@ -0,0 +1,35 @@ +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +public interface IWrapperPages { + + int getPage(); + + void setPage(int page); + + int getTotalPages(); + + void setTotalPages(int totalPages); + + int getTotalResults(); + + void setTotalResults(int totalResults); +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperAlternativeTitles.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperAlternativeTitles.java index d615e39f1..70e3da9bc 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperAlternativeTitles.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperAlternativeTitles.java @@ -1,76 +1,46 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.AlternativeTitle; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class WrapperAlternativeTitles { - /* - * Logger - */ - - private static final Logger LOG = LoggerFactory.getLogger(WrapperAlternativeTitles.class); - /* - * Properties - */ - @JsonProperty("id") - private int id; - @JsonProperty("titles") - private List titles; - - public int getId() { - return id; - } - - public List getTitles() { - return titles; - } - - public void setId(int id) { - this.id = id; - } - - public void setTitles(List titles) { - this.titles = titles; - } - - /** - * 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("'"); - LOG.trace(sb.toString()); - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.AlternativeTitle; +import java.util.List; + +/** + * + * @author Stuart + */ +public class WrapperAlternativeTitles extends AbstractWrapperId { + + @JsonProperty("titles") + private List titles; + + public WrapperAlternativeTitles() { + super(WrapperAlternativeTitles.class); + } + + public List getTitles() { + return titles; + } + + public void setTitles(List titles) { + this.titles = titles; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperChanges.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperChanges.java index 6ee334390..ebb5bffbc 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperChanges.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperChanges.java @@ -1,70 +1,46 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.MovieChanges; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -public class WrapperChanges { - /* - * Logger - */ - - private static final Logger LOG = LoggerFactory.getLogger(WrapperChanges.class); - /* - * Properties - */ - @JsonProperty("changes") - private List changes; - - // - public List getChanges() { - return changes; - } - // - - // - public void setChanges(List changes) { - this.changes = changes; - } - // - - /** - * 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("'"); - LOG.trace(sb.toString()); - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.MovieChanges; +import java.util.List; + +/** + * + * @author stuart.boston + */ +public class WrapperChanges extends AbstractWrapper { + + @JsonProperty("changes") + private List changes; + + public WrapperChanges() { + super(WrapperChanges.class); + } + + public List getChanges() { + return changes; + } + + public void setChanges(List changes) { + this.changes = changes; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperCollection.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperCollection.java index dfc95042e..399e98ccc 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperCollection.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperCollection.java @@ -1,50 +1,46 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.Collection; -import java.util.List; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -public class WrapperCollection extends WrapperBase { - /* - * Properties - */ - - @JsonProperty("results") - private List results; - - public WrapperCollection() { - super(LoggerFactory.getLogger(WrapperCollection.class)); - } - - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.Collection; +import java.util.List; + +/** + * + * @author stuart.boston + */ +public class WrapperCollection extends AbstractWrapperAll { + + @JsonProperty("results") + private List results; + + public WrapperCollection() { + super(WrapperCollection.class); + } + + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperCompany.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperCompany.java index 0b56611d4..9e1547776 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperCompany.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperCompany.java @@ -1,50 +1,46 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.Company; -import java.util.List; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -public class WrapperCompany extends WrapperBase { - /* - * Properties - */ - - @JsonProperty("results") - private List results; - - public WrapperCompany() { - super(LoggerFactory.getLogger(WrapperCompany.class)); - } - - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.Company; +import java.util.List; + +/** + * + * @author stuart.boston + */ +public class WrapperCompany extends AbstractWrapperAll { + + @JsonProperty("results") + private List results; + + public WrapperCompany() { + super(WrapperCompany.class); + } + + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperCompanyMovies.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperCompanyMovies.java index 9f7e8f0a4..5e34bcd81 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperCompanyMovies.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperCompanyMovies.java @@ -1,62 +1,58 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.MovieDb; -import java.util.List; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -public class WrapperCompanyMovies extends WrapperBase { - /* - * Properties - */ - - @JsonProperty("results") - private List results; - - public WrapperCompanyMovies() { - super(LoggerFactory.getLogger(WrapperCompanyMovies.class)); - } - - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("[ResultList=["); - sb.append("[companyId=").append(getId()); - sb.append("],[page=").append(getPage()); - sb.append("],[pageResults=").append(getResults().size()); - sb.append("],[totalPages=").append(getTotalPages()); - sb.append("],[totalResults=").append(getTotalResults()); - sb.append("]]"); - return sb.toString(); - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.MovieDb; +import java.util.List; + +/** + * + * @author stuart.boston + */ +public class WrapperCompanyMovies extends AbstractWrapperAll { + + @JsonProperty("results") + private List results; + + public WrapperCompanyMovies() { + super(WrapperCompanyMovies.class); + } + + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("[ResultList=["); + sb.append("[companyId=").append(getId()); + sb.append("],[page=").append(getPage()); + sb.append("],[pageResults=").append(getResults().size()); + sb.append("],[totalPages=").append(getTotalPages()); + sb.append("],[totalResults=").append(getTotalResults()); + sb.append("]]"); + return sb.toString(); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperConfig.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperConfig.java index 25bceede1..55ea24663 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperConfig.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperConfig.java @@ -1,77 +1,57 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.TmdbConfiguration; -import java.util.Collections; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class WrapperConfig { - /* - * Logger - */ - - private static final Logger LOG = LoggerFactory.getLogger(WrapperConfig.class); - /* - * Properties - */ - @JsonProperty("images") - private TmdbConfiguration tmdbConfiguration; - @JsonProperty("change_keys") - private List changeKeys = Collections.EMPTY_LIST; - - public TmdbConfiguration getTmdbConfiguration() { - return tmdbConfiguration; - } - - public void setTmdbConfiguration(TmdbConfiguration tmdbConfiguration) { - this.tmdbConfiguration = tmdbConfiguration; - } - - public List getChangeKeys() { - return changeKeys; - } - - public void setChangeKeys(List changeKeys) { - this.changeKeys = changeKeys; - } - - /** - * 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("'"); - LOG.trace(sb.toString()); - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.TmdbConfiguration; +import java.util.Collections; +import java.util.List; + +/** + * + * @author Stuart + */ +public class WrapperConfig extends AbstractWrapper { + + @JsonProperty("images") + private TmdbConfiguration tmdbConfiguration; + @JsonProperty("change_keys") + private List changeKeys = Collections.EMPTY_LIST; + + public WrapperConfig() { + super(WrapperConfig.class); + } + + public TmdbConfiguration getTmdbConfiguration() { + return tmdbConfiguration; + } + + public void setTmdbConfiguration(TmdbConfiguration tmdbConfiguration) { + this.tmdbConfiguration = tmdbConfiguration; + } + + public List getChangeKeys() { + return changeKeys; + } + + public void setChangeKeys(List changeKeys) { + this.changeKeys = changeKeys; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperGenres.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperGenres.java index fba87f307..91014a1e2 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperGenres.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperGenres.java @@ -1,67 +1,47 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.Genre; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Wrapper class for the Genres searches - * - * @author Stuart - */ -public class WrapperGenres { - /* - * Logger - */ - - private static final Logger LOG = LoggerFactory.getLogger(WrapperGenres.class); - /* - * Properties - */ - @JsonProperty("genres") - private List genres; - - public List getGenres() { - return genres; - } - - public void setGenres(List genres) { - this.genres = genres; - } - - /** - * 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("'"); - LOG.trace(sb.toString()); - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.Genre; +import java.util.List; + +/** + * Wrapper class for the Genres searches + * + * @author Stuart + */ +public class WrapperGenres extends AbstractWrapper { + + @JsonProperty("genres") + private List genres; + + public WrapperGenres() { + super(WrapperGenres.class); + } + + public List getGenres() { + return genres; + } + + public void setGenres(List genres) { + this.genres = genres; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperImages.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperImages.java index 184475398..55ca071cf 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperImages.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperImages.java @@ -26,16 +26,12 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.slf4j.LoggerFactory; /** * * @author Stuart */ -public class WrapperImages extends WrapperBase { - /* - * Properties - */ +public class WrapperImages extends AbstractWrapperAll { @JsonProperty("backdrops") private List backdrops = Collections.EMPTY_LIST; @@ -45,10 +41,9 @@ public class WrapperImages extends WrapperBase { private List profiles = Collections.EMPTY_LIST; public WrapperImages() { - super(LoggerFactory.getLogger(WrapperImages.class)); + super(WrapperImages.class); } - // public List getBackdrops() { return backdrops; } @@ -60,9 +55,7 @@ public class WrapperImages extends WrapperBase { public List getProfiles() { return profiles; } - // - // public void setBackdrops(List backdrops) { this.backdrops = backdrops; } @@ -74,7 +67,6 @@ public class WrapperImages extends WrapperBase { public void setProfiles(List profiles) { this.profiles = profiles; } - // /** * Return a list of all the artwork with their types. diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperJobList.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperJobList.java index 98fac98e2..2bc7786c7 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperJobList.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperJobList.java @@ -19,26 +19,23 @@ */ 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.JobDepartment; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * * @author Stuart */ -public class WrapperJobList { +public class WrapperJobList extends AbstractWrapper { - // Logger - private static final Logger LOG = LoggerFactory.getLogger(WrapperJobList.class); - // Properties @JsonProperty("jobs") private List jobs; + public WrapperJobList() { + super(WrapperJobList.class); + } + public List getJobs() { return jobs; } @@ -46,18 +43,4 @@ public class WrapperJobList { public void setJobs(List jobs) { this.jobs = jobs; } - - /** - * 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("'"); - LOG.trace(sb.toString()); - } } diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperKeywordMovies.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperKeywordMovies.java index f116b11da..cdac45e58 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperKeywordMovies.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperKeywordMovies.java @@ -1,50 +1,46 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.KeywordMovie; -import java.util.List; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -public class WrapperKeywordMovies extends WrapperBase { - /* - * Properties - */ - - @JsonProperty("results") - private List results; - - public WrapperKeywordMovies() { - super(LoggerFactory.getLogger(WrapperKeywordMovies.class)); - } - - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.KeywordMovie; +import java.util.List; + +/** + * + * @author stuart.boston + */ +public class WrapperKeywordMovies extends AbstractWrapperAll { + + @JsonProperty("results") + private List results; + + public WrapperKeywordMovies() { + super(WrapperKeywordMovies.class); + } + + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperKeywords.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperKeywords.java index 85016c045..38d43b5f4 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperKeywords.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperKeywords.java @@ -1,50 +1,46 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.Keyword; -import java.util.List; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -public class WrapperKeywords extends WrapperBase { - /* - * Properties - */ - - @JsonProperty("results") - private List results; - - public WrapperKeywords() { - super(LoggerFactory.getLogger(WrapperKeywords.class)); - } - - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.Keyword; +import java.util.List; + +/** + * + * @author stuart.boston + */ +public class WrapperKeywords extends AbstractWrapperAll { + + @JsonProperty("results") + private List results; + + public WrapperKeywords() { + super(WrapperKeywords.class); + } + + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovie.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovie.java index 94f2abbb7..4e44e8224 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovie.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovie.java @@ -1,62 +1,59 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.MovieDb; -import java.util.List; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -public class WrapperMovie extends WrapperBase { - /* - * Properties - */ - - @JsonProperty("results") - private List movies; - - public WrapperMovie() { - super(LoggerFactory.getLogger(WrapperMovie.class)); - } - - public List getMovies() { - return movies; - } - - public void setMovies(List movies) { - this.movies = movies; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("[ResultList=["); - sb.append("[page=").append(getPage()); - sb.append("],[pageResults=").append(getMovies().size()); - sb.append("],[totalPages=").append(getTotalPages()); - sb.append("],[totalResults=").append(getTotalResults()); - sb.append("],[id=").append(getId()); - sb.append("]]"); - return sb.toString(); - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.MovieDb; +import java.util.List; +import org.slf4j.LoggerFactory; + +/** + * + * @author stuart.boston + */ +public class WrapperMovie extends AbstractWrapperAll { + + @JsonProperty("results") + private List movies; + + public WrapperMovie() { + super(WrapperMovie.class); + } + + public List getMovies() { + return movies; + } + + public void setMovies(List movies) { + this.movies = movies; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("[ResultList=["); + sb.append("[page=").append(getPage()); + sb.append("],[pageResults=").append(getMovies().size()); + sb.append("],[totalPages=").append(getTotalPages()); + sb.append("],[totalResults=").append(getTotalResults()); + sb.append("],[id=").append(getId()); + sb.append("]]"); + return sb.toString(); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieCasts.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieCasts.java index 30183409c..b4bd75255 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieCasts.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieCasts.java @@ -1,91 +1,57 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.PersonCast; -import com.omertron.themoviedbapi.model.PersonCrew; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class WrapperMovieCasts { - /* - * Logger - */ - - private static final Logger LOG = LoggerFactory.getLogger(WrapperMovieCasts.class); - /* - * Properties - */ - @JsonProperty("id") - private int id; - @JsonProperty("cast") - private List cast; - @JsonProperty("crew") - private List crew; - - // - public List getCast() { - return cast; - } - - public List getCrew() { - return crew; - } - - public int getId() { - return id; - } - // - - // - public void setCast(List cast) { - this.cast = cast; - } - - public void setCrew(List crew) { - this.crew = crew; - } - - public void setId(int id) { - this.id = id; - } - // - - /** - * 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("'"); - LOG.trace(sb.toString()); - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.PersonCast; +import com.omertron.themoviedbapi.model.PersonCrew; +import java.util.List; + +/** + * + * @author Stuart + */ +public class WrapperMovieCasts extends AbstractWrapperId { + + @JsonProperty("cast") + private List cast; + @JsonProperty("crew") + private List crew; + + public WrapperMovieCasts() { + super(WrapperMovieCasts.class); + } + + public List getCast() { + return cast; + } + + public List getCrew() { + return crew; + } + + public void setCast(List cast) { + this.cast = cast; + } + + public void setCrew(List crew) { + this.crew = crew; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieKeywords.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieKeywords.java index d7da5bf23..6249c04c2 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieKeywords.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieKeywords.java @@ -1,80 +1,46 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.Keyword; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class WrapperMovieKeywords { - /* - * Logger - */ - - private static final Logger LOG = LoggerFactory.getLogger(WrapperMovieKeywords.class); - /* - * Properties - */ - @JsonProperty("id") - private int id; - @JsonProperty("keywords") - private List keywords; - - // - public int getId() { - return id; - } - - public List getKeywords() { - return keywords; - } - // - - // - public void setId(int id) { - this.id = id; - } - - public void setKeywords(List keywords) { - this.keywords = keywords; - } - // - - /** - * 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("'"); - LOG.trace(sb.toString()); - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.Keyword; +import java.util.List; + +/** + * + * @author Stuart + */ +public class WrapperMovieKeywords extends AbstractWrapperId { + + @JsonProperty("keywords") + private List keywords; + + public WrapperMovieKeywords() { + super(WrapperMovieKeywords.class); + } + + public List getKeywords() { + return keywords; + } + + public void setKeywords(List keywords) { + this.keywords = keywords; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieList.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieList.java index 3dec844fb..9a285d23a 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieList.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperMovieList.java @@ -1,50 +1,46 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.MovieList; -import java.util.List; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class WrapperMovieList extends WrapperBase { - /* - * Properties - */ - - @JsonProperty("results") - private List movieList; - - public WrapperMovieList() { - super(LoggerFactory.getLogger(WrapperMovieList.class)); - } - - public List getMovieList() { - return movieList; - } - - public void setMovieList(List movieList) { - this.movieList = movieList; - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.MovieList; +import java.util.List; + +/** + * + * @author Stuart + */ +public class WrapperMovieList extends AbstractWrapperAll { + + @JsonProperty("results") + private List movieList; + + public WrapperMovieList() { + super(WrapperMovieList.class); + } + + public List getMovieList() { + return movieList; + } + + public void setMovieList(List movieList) { + this.movieList = movieList; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperPerson.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperPerson.java index 70d5ab6ac..0c3cdc926 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperPerson.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperPerson.java @@ -1,50 +1,46 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.Person; -import java.util.List; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -public class WrapperPerson extends WrapperBase { - /* - * Properties - */ - - @JsonProperty("results") - private List results; - - public WrapperPerson() { - super(LoggerFactory.getLogger(WrapperPerson.class)); - } - - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.Person; +import java.util.List; + +/** + * + * @author stuart.boston + */ +public class WrapperPerson extends AbstractWrapperAll { + + @JsonProperty("results") + private List results; + + public WrapperPerson() { + super(WrapperPerson.class); + } + + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperPersonCredits.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperPersonCredits.java index 2ba1dec94..24e672c77 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperPersonCredits.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperPersonCredits.java @@ -1,60 +1,56 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.PersonCredit; -import java.util.List; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -public class WrapperPersonCredits extends WrapperBase { - /* - * Properties - */ - - @JsonProperty("cast") - private List cast; - @JsonProperty("crew") - private List crew; - - public WrapperPersonCredits() { - super(LoggerFactory.getLogger(WrapperMovieCasts.class)); - } - - public List getCast() { - return cast; - } - - public void setCast(List cast) { - this.cast = cast; - } - - public List getCrew() { - return crew; - } - - public void setCrew(List crew) { - this.crew = crew; - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.PersonCredit; +import java.util.List; + +/** + * + * @author stuart.boston + */ +public class WrapperPersonCredits extends AbstractWrapperAll { + + @JsonProperty("cast") + private List cast; + @JsonProperty("crew") + private List crew; + + public WrapperPersonCredits() { + super(WrapperMovieCasts.class); + } + + public List getCast() { + return cast; + } + + public void setCast(List cast) { + this.cast = cast; + } + + public List getCrew() { + return crew; + } + + public void setCrew(List crew) { + this.crew = crew; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperPersonList.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperPersonList.java index 195efb144..8209a706b 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperPersonList.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperPersonList.java @@ -20,25 +20,20 @@ package com.omertron.themoviedbapi.wrapper; import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.MovieList; import com.omertron.themoviedbapi.model.Person; import java.util.List; -import org.slf4j.LoggerFactory; /** * * @author Stuart */ -public class WrapperPersonList extends WrapperBase { - /* - * Properties - */ +public class WrapperPersonList extends AbstractWrapperAll { @JsonProperty("results") private List personList; public WrapperPersonList() { - super(LoggerFactory.getLogger(WrapperPersonList.class)); + super(WrapperPersonList.class); } public List getPersonList() { diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperReleaseInfo.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperReleaseInfo.java index caf4b59b7..cf137365a 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperReleaseInfo.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperReleaseInfo.java @@ -1,80 +1,46 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.ReleaseInfo; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class WrapperReleaseInfo { - /* - * Logger - */ - - private static final Logger LOG = LoggerFactory.getLogger(WrapperReleaseInfo.class); - /* - * Properties - */ - @JsonProperty("id") - private int id; - @JsonProperty("countries") - private List countries; - - // - public List getCountries() { - return countries; - } - - public int getId() { - return id; - } - // - - // - public void setCountries(List countries) { - this.countries = countries; - } - - public void setId(int id) { - this.id = id; - } - // - - /** - * 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("'"); - LOG.trace(sb.toString()); - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.ReleaseInfo; +import java.util.List; + +/** + * + * @author Stuart + */ +public class WrapperReleaseInfo extends AbstractWrapperId { + + @JsonProperty("countries") + private List countries; + + public WrapperReleaseInfo() { + super(WrapperReleaseInfo.class); + } + + public List getCountries() { + return countries; + } + + public void setCountries(List countries) { + this.countries = countries; + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperReviews.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperReviews.java index fa450f2aa..bd5853006 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperReviews.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperReviews.java @@ -22,22 +22,18 @@ package com.omertron.themoviedbapi.wrapper; import com.fasterxml.jackson.annotation.JsonProperty; import com.omertron.themoviedbapi.model.Reviews; import java.util.List; -import org.slf4j.LoggerFactory; /** * * @author stuart.boston */ -public class WrapperReviews extends WrapperBase { - /* - * Properties - */ +public class WrapperReviews extends AbstractWrapperAll { @JsonProperty("results") private List reviews; public WrapperReviews() { - super(LoggerFactory.getLogger(WrapperReviews.class)); + super(WrapperReviews.class); } public List getReviews() { diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperTrailers.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperTrailers.java index 2b3098ca6..0685b4fe6 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperTrailers.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperTrailers.java @@ -19,37 +19,24 @@ */ package com.omertron.themoviedbapi.wrapper; -import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonProperty; import com.omertron.themoviedbapi.model.Trailer; import java.util.ArrayList; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * * @author Stuart */ -public class WrapperTrailers { - /* - * Logger - */ +public class WrapperTrailers extends AbstractWrapperId { - private static final Logger LOG = LoggerFactory.getLogger(WrapperTrailers.class); - /* - * Properties - */ - @JsonProperty("id") - private int id; @JsonProperty("quicktime") private List quicktime; @JsonProperty("youtube") private List youtube; - // - public int getId() { - return id; + public WrapperTrailers() { + super(WrapperTrailers.class); } public List getQuicktime() { @@ -59,12 +46,6 @@ public class WrapperTrailers { public List getYoutube() { return youtube; } - // - - // - public void setId(int id) { - this.id = id; - } public void setQuicktime(List quicktime) { this.quicktime = quicktime; @@ -73,10 +54,10 @@ public class WrapperTrailers { public void setYoutube(List youtube) { this.youtube = youtube; } - // /** * Get a combined list of the trailers with their source website + * * @return */ public List getAll() { @@ -95,18 +76,4 @@ public class WrapperTrailers { return trailers; } - - /** - * 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("'"); - LOG.trace(sb.toString()); - } } diff --git a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperTranslations.java b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperTranslations.java index 507cc0bc9..b70339e62 100644 --- a/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperTranslations.java +++ b/src/main/java/com/omertron/themoviedbapi/wrapper/WrapperTranslations.java @@ -1,80 +1,46 @@ -/* - * 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 . - * - */ -package com.omertron.themoviedbapi.wrapper; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.omertron.themoviedbapi.model.Translation; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class WrapperTranslations { - /* - * Logger - */ - - private static final Logger LOG = LoggerFactory.getLogger(WrapperTranslations.class); - /* - * Properties - */ - @JsonProperty("id") - private int id; - @JsonProperty("translations") - private List translations; - - // - public void setId(int id) { - this.id = id; - } - - public void setTranslations(List translations) { - this.translations = translations; - } - // - - // - public int getId() { - return id; - } - - public List getTranslations() { - return translations; - } - // - - /** - * 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("'"); - LOG.trace(sb.toString()); - } -} +/* + * 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 . + * + */ +package com.omertron.themoviedbapi.wrapper; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.omertron.themoviedbapi.model.Translation; +import java.util.List; + +/** + * + * @author Stuart + */ +public class WrapperTranslations extends AbstractWrapperId { + + @JsonProperty("translations") + private List translations; + + public WrapperTranslations() { + super(WrapperTranslations.class); + } + + public void setTranslations(List translations) { + this.translations = translations; + } + + public List getTranslations() { + return translations; + } +}