From 9a237042f0b221914384bc7d175357edcbd585a5 Mon Sep 17 00:00:00 2001 From: Stuart Boston Date: Wed, 24 Jul 2013 16:47:50 +0100 Subject: [PATCH] Change ToString style to "Simple" --- .../themoviedbapi/model/AlternativeTitle.java | 228 +++--- .../omertron/themoviedbapi/model/Artwork.java | 404 +++++------ .../themoviedbapi/model/ChangeKeyItem.java | 2 +- .../themoviedbapi/model/ChangedItem.java | 2 +- .../themoviedbapi/model/Collection.java | 344 ++++----- .../themoviedbapi/model/CollectionInfo.java | 2 +- .../omertron/themoviedbapi/model/Company.java | 2 +- .../omertron/themoviedbapi/model/Genre.java | 230 +++--- .../themoviedbapi/model/JobDepartment.java | 2 +- .../omertron/themoviedbapi/model/Keyword.java | 232 +++--- .../themoviedbapi/model/KeywordMovie.java | 344 ++++----- .../themoviedbapi/model/Language.java | 230 +++--- .../omertron/themoviedbapi/model/MovieDb.java | 2 +- .../themoviedbapi/model/MovieDbList.java | 316 ++++----- .../themoviedbapi/model/MovieList.java | 296 ++++---- .../omertron/themoviedbapi/model/Person.java | 658 +++++++++--------- .../themoviedbapi/model/PersonCast.java | 338 ++++----- .../themoviedbapi/model/PersonCredit.java | 338 ++++----- .../themoviedbapi/model/PersonCrew.java | 308 ++++---- .../model/ProductionCompany.java | 232 +++--- .../model/ProductionCountry.java | 232 +++--- .../themoviedbapi/model/ReleaseInfo.java | 256 +++---- .../omertron/themoviedbapi/model/Reviews.java | 2 +- .../themoviedbapi/model/StatusCode.java | 176 ++--- .../model/TmdbConfiguration.java | 404 +++++------ .../model/TokenAuthorisation.java | 182 ++--- .../themoviedbapi/model/TokenSession.java | 244 +++---- .../omertron/themoviedbapi/model/Trailer.java | 278 ++++---- .../themoviedbapi/model/Translation.java | 256 +++---- 29 files changed, 3270 insertions(+), 3270 deletions(-) diff --git a/src/main/java/com/omertron/themoviedbapi/model/AlternativeTitle.java b/src/main/java/com/omertron/themoviedbapi/model/AlternativeTitle.java index ccc7f0972..b4aa5851b 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/AlternativeTitle.java +++ b/src/main/java/com/omertron/themoviedbapi/model/AlternativeTitle.java @@ -1,114 +1,114 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class AlternativeTitle implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(AlternativeTitle.class); - /* - * Properties - */ - @JsonProperty("iso_3166_1") - private String country; - @JsonProperty("title") - private String title; - - // - public String getCountry() { - return country; - } - - public String getTitle() { - return title; - } - // - - // - public void setCountry(String country) { - this.country = country; - } - - public void setTitle(String title) { - this.title = title; - } - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AlternativeTitle other = (AlternativeTitle) obj; - if ((this.country == null) ? (other.country != null) : !this.country.equals(other.country)) { - return false; - } - if ((this.title == null) ? (other.title != null) : !this.title.equals(other.title)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 89 * hash + (this.country != null ? this.country.hashCode() : 0); - hash = 89 * hash + (this.title != null ? this.title.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Stuart + */ +public class AlternativeTitle implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(AlternativeTitle.class); + /* + * Properties + */ + @JsonProperty("iso_3166_1") + private String country; + @JsonProperty("title") + private String title; + + // + public String getCountry() { + return country; + } + + public String getTitle() { + return title; + } + // + + // + public void setCountry(String country) { + this.country = country; + } + + public void setTitle(String title) { + this.title = title; + } + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final AlternativeTitle other = (AlternativeTitle) obj; + if ((this.country == null) ? (other.country != null) : !this.country.equals(other.country)) { + return false; + } + if ((this.title == null) ? (other.title != null) : !this.title.equals(other.title)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 89 * hash + (this.country != null ? this.country.hashCode() : 0); + hash = 89 * hash + (this.title != null ? this.title.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/Artwork.java b/src/main/java/com/omertron/themoviedbapi/model/Artwork.java index 4af944c28..3074f1097 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/Artwork.java +++ b/src/main/java/com/omertron/themoviedbapi/model/Artwork.java @@ -1,202 +1,202 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The artwork type information - * - * @author Stuart - */ -public class Artwork implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(Artwork.class); - /* - * Properties - */ - @JsonProperty("aspect_ratio") - private float aspectRatio; - @JsonProperty("file_path") - private String filePath; - @JsonProperty("height") - private int height; - @JsonProperty("iso_639_1") - private String language; - @JsonProperty("width") - private int width; - @JsonProperty("vote_average") - private float voteAverage; - @JsonProperty("vote_count") - private int voteCount; - @JsonProperty("flag") - private String flag; - private ArtworkType artworkType = ArtworkType.POSTER; - - // - public ArtworkType getArtworkType() { - return artworkType; - } - - public float getAspectRatio() { - return aspectRatio; - } - - public String getFilePath() { - return filePath; - } - - public int getHeight() { - return height; - } - - public String getLanguage() { - return language; - } - - public int getWidth() { - return width; - } - - public float getVoteAverage() { - return voteAverage; - } - - public int getVoteCount() { - return voteCount; - } - - public String getFlag() { - return flag; - } - - // - - // - public void setArtworkType(ArtworkType artworkType) { - this.artworkType = artworkType; - } - - public void setAspectRatio(float aspectRatio) { - this.aspectRatio = aspectRatio; - } - - public void setFilePath(String filePath) { - this.filePath = filePath; - } - - public void setHeight(int height) { - this.height = height; - } - - public void setLanguage(String language) { - this.language = language; - } - - public void setWidth(int width) { - this.width = width; - } - - public void setVoteAverage(float voteAverage) { - this.voteAverage = voteAverage; - } - - public void setVoteCount(int voteCount) { - this.voteCount = voteCount; - } - - public void setFlag(String flag) { - this.flag = flag; - } - - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final Artwork other = (Artwork) obj; - if (Float.floatToIntBits(this.aspectRatio) != Float.floatToIntBits(other.aspectRatio)) { - return false; - } - if ((this.filePath == null) ? (other.filePath != null) : !this.filePath.equals(other.filePath)) { - return false; - } - if (this.height != other.height) { - return false; - } - if ((this.language == null) ? (other.language != null) : !this.language.equals(other.language)) { - return false; - } - if (this.width != other.width) { - return false; - } - if (this.artworkType != other.artworkType) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 3; - hash = 71 * hash + Float.floatToIntBits(this.aspectRatio); - hash = 71 * hash + (this.filePath != null ? this.filePath.hashCode() : 0); - hash = 71 * hash + this.height; - hash = 71 * hash + (this.language != null ? this.language.hashCode() : 0); - hash = 71 * hash + this.width; - hash = 71 * hash + (this.artworkType != null ? this.artworkType.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The artwork type information + * + * @author Stuart + */ +public class Artwork implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(Artwork.class); + /* + * Properties + */ + @JsonProperty("aspect_ratio") + private float aspectRatio; + @JsonProperty("file_path") + private String filePath; + @JsonProperty("height") + private int height; + @JsonProperty("iso_639_1") + private String language; + @JsonProperty("width") + private int width; + @JsonProperty("vote_average") + private float voteAverage; + @JsonProperty("vote_count") + private int voteCount; + @JsonProperty("flag") + private String flag; + private ArtworkType artworkType = ArtworkType.POSTER; + + // + public ArtworkType getArtworkType() { + return artworkType; + } + + public float getAspectRatio() { + return aspectRatio; + } + + public String getFilePath() { + return filePath; + } + + public int getHeight() { + return height; + } + + public String getLanguage() { + return language; + } + + public int getWidth() { + return width; + } + + public float getVoteAverage() { + return voteAverage; + } + + public int getVoteCount() { + return voteCount; + } + + public String getFlag() { + return flag; + } + + // + + // + public void setArtworkType(ArtworkType artworkType) { + this.artworkType = artworkType; + } + + public void setAspectRatio(float aspectRatio) { + this.aspectRatio = aspectRatio; + } + + public void setFilePath(String filePath) { + this.filePath = filePath; + } + + public void setHeight(int height) { + this.height = height; + } + + public void setLanguage(String language) { + this.language = language; + } + + public void setWidth(int width) { + this.width = width; + } + + public void setVoteAverage(float voteAverage) { + this.voteAverage = voteAverage; + } + + public void setVoteCount(int voteCount) { + this.voteCount = voteCount; + } + + public void setFlag(String flag) { + this.flag = flag; + } + + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Artwork other = (Artwork) obj; + if (Float.floatToIntBits(this.aspectRatio) != Float.floatToIntBits(other.aspectRatio)) { + return false; + } + if ((this.filePath == null) ? (other.filePath != null) : !this.filePath.equals(other.filePath)) { + return false; + } + if (this.height != other.height) { + return false; + } + if ((this.language == null) ? (other.language != null) : !this.language.equals(other.language)) { + return false; + } + if (this.width != other.width) { + return false; + } + if (this.artworkType != other.artworkType) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 71 * hash + Float.floatToIntBits(this.aspectRatio); + hash = 71 * hash + (this.filePath != null ? this.filePath.hashCode() : 0); + hash = 71 * hash + this.height; + hash = 71 * hash + (this.language != null ? this.language.hashCode() : 0); + hash = 71 * hash + this.width; + hash = 71 * hash + (this.artworkType != null ? this.artworkType.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/ChangeKeyItem.java b/src/main/java/com/omertron/themoviedbapi/model/ChangeKeyItem.java index b884d22e9..8105eec33 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/ChangeKeyItem.java +++ b/src/main/java/com/omertron/themoviedbapi/model/ChangeKeyItem.java @@ -47,6 +47,6 @@ public class ChangeKeyItem { @Override public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); } } diff --git a/src/main/java/com/omertron/themoviedbapi/model/ChangedItem.java b/src/main/java/com/omertron/themoviedbapi/model/ChangedItem.java index 73be6dba6..b9064cc48 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/ChangedItem.java +++ b/src/main/java/com/omertron/themoviedbapi/model/ChangedItem.java @@ -75,6 +75,6 @@ public class ChangedItem { @Override public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); } } diff --git a/src/main/java/com/omertron/themoviedbapi/model/Collection.java b/src/main/java/com/omertron/themoviedbapi/model/Collection.java index 03926eb3f..aa5e93101 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/Collection.java +++ b/src/main/java/com/omertron/themoviedbapi/model/Collection.java @@ -1,172 +1,172 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import java.io.Serializable; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -@JsonRootName("collection") -public class Collection implements Serializable { - - private static final long serialVersionUID = 1L; - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(Collection.class); - /* - * Properties - */ - @JsonProperty("id") - private int id; - @JsonProperty("title") - private String title; - @JsonProperty("name") - private String name; - @JsonProperty("poster_path") - private String posterPath; - @JsonProperty("backdrop_path") - private String backdropPath; - @JsonProperty("release_date") - private String releaseDate; - - // - public String getBackdropPath() { - return backdropPath; - } - - public int getId() { - return id; - } - - public String getPosterPath() { - return posterPath; - } - - public String getReleaseDate() { - return releaseDate; - } - - public String getTitle() { - if (StringUtils.isBlank(title)) { - return name; - } - return title; - } - - public String getName() { - if (StringUtils.isBlank(name)) { - return title; - } - return name; - } - // - - // - public void setBackdropPath(String backdropPath) { - this.backdropPath = backdropPath; - } - - public void setId(int id) { - this.id = id; - } - - public void setPosterPath(String posterPath) { - this.posterPath = posterPath; - } - - public void setReleaseDate(String releaseDate) { - this.releaseDate = releaseDate; - } - - public void setTitle(String title) { - this.title = title; - } - - public void setName(String name) { - this.name = name; - } - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final Collection other = (Collection) obj; - if ((this.backdropPath == null) ? (other.backdropPath != null) : !this.backdropPath.equals(other.backdropPath)) { - return false; - } - if (this.id != other.id) { - return false; - } - if ((this.title == null) ? (other.title != null) : !this.title.equals(other.title)) { - return false; - } - if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 19 * hash + (this.backdropPath != null ? this.backdropPath.hashCode() : 0); - hash = 19 * hash + this.id; - hash = 19 * hash + (this.title != null ? this.title.hashCode() : 0); - hash = 19 * hash + (this.name != null ? this.name.hashCode() : 0); - hash = 19 * hash + (this.posterPath != null ? this.posterPath.hashCode() : 0); - hash = 19 * hash + (this.releaseDate != null ? this.releaseDate.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import java.io.Serializable; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author stuart.boston + */ +@JsonRootName("collection") +public class Collection implements Serializable { + + private static final long serialVersionUID = 1L; + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(Collection.class); + /* + * Properties + */ + @JsonProperty("id") + private int id; + @JsonProperty("title") + private String title; + @JsonProperty("name") + private String name; + @JsonProperty("poster_path") + private String posterPath; + @JsonProperty("backdrop_path") + private String backdropPath; + @JsonProperty("release_date") + private String releaseDate; + + // + public String getBackdropPath() { + return backdropPath; + } + + public int getId() { + return id; + } + + public String getPosterPath() { + return posterPath; + } + + public String getReleaseDate() { + return releaseDate; + } + + public String getTitle() { + if (StringUtils.isBlank(title)) { + return name; + } + return title; + } + + public String getName() { + if (StringUtils.isBlank(name)) { + return title; + } + return name; + } + // + + // + public void setBackdropPath(String backdropPath) { + this.backdropPath = backdropPath; + } + + public void setId(int id) { + this.id = id; + } + + public void setPosterPath(String posterPath) { + this.posterPath = posterPath; + } + + public void setReleaseDate(String releaseDate) { + this.releaseDate = releaseDate; + } + + public void setTitle(String title) { + this.title = title; + } + + public void setName(String name) { + this.name = name; + } + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Collection other = (Collection) obj; + if ((this.backdropPath == null) ? (other.backdropPath != null) : !this.backdropPath.equals(other.backdropPath)) { + return false; + } + if (this.id != other.id) { + return false; + } + if ((this.title == null) ? (other.title != null) : !this.title.equals(other.title)) { + return false; + } + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 19 * hash + (this.backdropPath != null ? this.backdropPath.hashCode() : 0); + hash = 19 * hash + this.id; + hash = 19 * hash + (this.title != null ? this.title.hashCode() : 0); + hash = 19 * hash + (this.name != null ? this.name.hashCode() : 0); + hash = 19 * hash + (this.posterPath != null ? this.posterPath.hashCode() : 0); + hash = 19 * hash + (this.releaseDate != null ? this.releaseDate.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/CollectionInfo.java b/src/main/java/com/omertron/themoviedbapi/model/CollectionInfo.java index 815a24107..1823e4ce3 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/CollectionInfo.java +++ b/src/main/java/com/omertron/themoviedbapi/model/CollectionInfo.java @@ -124,6 +124,6 @@ public class CollectionInfo implements Serializable { @Override public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); } } diff --git a/src/main/java/com/omertron/themoviedbapi/model/Company.java b/src/main/java/com/omertron/themoviedbapi/model/Company.java index 62a86ba64..12e910056 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/Company.java +++ b/src/main/java/com/omertron/themoviedbapi/model/Company.java @@ -138,6 +138,6 @@ public class Company implements Serializable { @Override public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); } } diff --git a/src/main/java/com/omertron/themoviedbapi/model/Genre.java b/src/main/java/com/omertron/themoviedbapi/model/Genre.java index b62260e59..47d7adfea 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/Genre.java +++ b/src/main/java/com/omertron/themoviedbapi/model/Genre.java @@ -1,115 +1,115 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -@JsonRootName("genre") -public class Genre implements Serializable { - - private static final long serialVersionUID = 1L; - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(Genre.class); - /* - * Properties - */ - @JsonProperty("id") - private int id; - @JsonProperty("name") - private String name; - - // - public int getId() { - return id; - } - - public String getName() { - return name; - } - // - - // - public void setId(int id) { - this.id = id; - } - - public void setName(String name) { - this.name = name; - } - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final Genre other = (Genre) obj; - if (this.id != other.id) { - return false; - } - if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 5; - hash = 53 * hash + this.id; - hash = 53 * hash + (this.name != null ? this.name.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author stuart.boston + */ +@JsonRootName("genre") +public class Genre implements Serializable { + + private static final long serialVersionUID = 1L; + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(Genre.class); + /* + * Properties + */ + @JsonProperty("id") + private int id; + @JsonProperty("name") + private String name; + + // + public int getId() { + return id; + } + + public String getName() { + return name; + } + // + + // + public void setId(int id) { + this.id = id; + } + + public void setName(String name) { + this.name = name; + } + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Genre other = (Genre) obj; + if (this.id != other.id) { + return false; + } + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 53 * hash + this.id; + hash = 53 * hash + (this.name != null ? this.name.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/JobDepartment.java b/src/main/java/com/omertron/themoviedbapi/model/JobDepartment.java index c7335e746..3effe77d0 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/JobDepartment.java +++ b/src/main/java/com/omertron/themoviedbapi/model/JobDepartment.java @@ -74,6 +74,6 @@ public class JobDepartment { @Override public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); } } diff --git a/src/main/java/com/omertron/themoviedbapi/model/Keyword.java b/src/main/java/com/omertron/themoviedbapi/model/Keyword.java index 80cef7cf9..00005df7e 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/Keyword.java +++ b/src/main/java/com/omertron/themoviedbapi/model/Keyword.java @@ -1,116 +1,116 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -@JsonRootName("keyword") -public class Keyword implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(Keyword.class); - /* - * Properties - */ - @JsonProperty("id") - private int id; - @JsonProperty("name") - private String name; - - // - public int getId() { - return id; - } - - public String getName() { - return name; - } - // - - // - public void setId(int id) { - this.id = id; - } - - public void setName(String name) { - this.name = name; - } - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final Keyword other = (Keyword) obj; - if (this.id != other.id) { - return false; - } - if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 3; - hash = 83 * hash + this.id; - hash = 83 * hash + (this.name != null ? this.name.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author stuart.boston + */ +@JsonRootName("keyword") +public class Keyword implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(Keyword.class); + /* + * Properties + */ + @JsonProperty("id") + private int id; + @JsonProperty("name") + private String name; + + // + public int getId() { + return id; + } + + public String getName() { + return name; + } + // + + // + public void setId(int id) { + this.id = id; + } + + public void setName(String name) { + this.name = name; + } + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Keyword other = (Keyword) obj; + if (this.id != other.id) { + return false; + } + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 83 * hash + this.id; + hash = 83 * hash + (this.name != null ? this.name.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/KeywordMovie.java b/src/main/java/com/omertron/themoviedbapi/model/KeywordMovie.java index b1efec2cf..42ee4060f 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/KeywordMovie.java +++ b/src/main/java/com/omertron/themoviedbapi/model/KeywordMovie.java @@ -1,172 +1,172 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class KeywordMovie implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(KeywordMovie.class); - /* - * Properties - */ - @JsonProperty("id") - private String id; - @JsonProperty("backdrop_path") - private String backdropPath; - @JsonProperty("original_title") - private String originalTitle; - @JsonProperty("release_date") - private String releaseDate; - @JsonProperty("poster_path") - private String posterPath; - @JsonProperty("title") - private String title; - @JsonProperty("vote_average") - private float voteAverage; - @JsonProperty("vote_count") - private double voteCount; - @JsonProperty("adult") - private boolean adult; - @JsonProperty("popularity") - private float popularity; - - // - public static long getSerialVersionUID() { - return serialVersionUID; - } - - public String getBackdropPath() { - return backdropPath; - } - - public String getId() { - return id; - } - - public String getOriginalTitle() { - return originalTitle; - } - - public String getReleaseDate() { - return releaseDate; - } - - public String getPosterPath() { - return posterPath; - } - - public String getTitle() { - return title; - } - - public float getVoteAverage() { - return voteAverage; - } - - public double getVoteCount() { - return voteCount; - } - - public boolean isAdult() { - return adult; - } - - public float getPopularity() { - return popularity; - } - // - - // - public void setBackdropPath(String backdropPath) { - this.backdropPath = backdropPath; - } - - public void setId(String id) { - this.id = id; - } - - public void setOriginalTitle(String originalTitle) { - this.originalTitle = originalTitle; - } - - public void setReleaseDate(String releaseDate) { - this.releaseDate = releaseDate; - } - - public void setPosterPath(String posterPath) { - this.posterPath = posterPath; - } - - public void setTitle(String title) { - this.title = title; - } - - public void setVoteAverage(float voteAverage) { - this.voteAverage = voteAverage; - } - - public void setVoteCount(double voteCount) { - this.voteCount = voteCount; - } - - public void setAdult(boolean adult) { - this.adult = adult; - } - - public void setPopularity(float popularity) { - this.popularity = popularity; - } - // - - /** - * 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()); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Stuart + */ +public class KeywordMovie implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(KeywordMovie.class); + /* + * Properties + */ + @JsonProperty("id") + private String id; + @JsonProperty("backdrop_path") + private String backdropPath; + @JsonProperty("original_title") + private String originalTitle; + @JsonProperty("release_date") + private String releaseDate; + @JsonProperty("poster_path") + private String posterPath; + @JsonProperty("title") + private String title; + @JsonProperty("vote_average") + private float voteAverage; + @JsonProperty("vote_count") + private double voteCount; + @JsonProperty("adult") + private boolean adult; + @JsonProperty("popularity") + private float popularity; + + // + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public String getBackdropPath() { + return backdropPath; + } + + public String getId() { + return id; + } + + public String getOriginalTitle() { + return originalTitle; + } + + public String getReleaseDate() { + return releaseDate; + } + + public String getPosterPath() { + return posterPath; + } + + public String getTitle() { + return title; + } + + public float getVoteAverage() { + return voteAverage; + } + + public double getVoteCount() { + return voteCount; + } + + public boolean isAdult() { + return adult; + } + + public float getPopularity() { + return popularity; + } + // + + // + public void setBackdropPath(String backdropPath) { + this.backdropPath = backdropPath; + } + + public void setId(String id) { + this.id = id; + } + + public void setOriginalTitle(String originalTitle) { + this.originalTitle = originalTitle; + } + + public void setReleaseDate(String releaseDate) { + this.releaseDate = releaseDate; + } + + public void setPosterPath(String posterPath) { + this.posterPath = posterPath; + } + + public void setTitle(String title) { + this.title = title; + } + + public void setVoteAverage(float voteAverage) { + this.voteAverage = voteAverage; + } + + public void setVoteCount(double voteCount) { + this.voteCount = voteCount; + } + + public void setAdult(boolean adult) { + this.adult = adult; + } + + public void setPopularity(float popularity) { + this.popularity = popularity; + } + // + + /** + * 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()); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/Language.java b/src/main/java/com/omertron/themoviedbapi/model/Language.java index 17b7c1568..380afe858 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/Language.java +++ b/src/main/java/com/omertron/themoviedbapi/model/Language.java @@ -1,115 +1,115 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -@JsonRootName("spoken_language") -public class Language implements Serializable { - - private static final long serialVersionUID = 1L; - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(Language.class); - /* - * Properties - */ - @JsonProperty("iso_639_1") - private String isoCode; - @JsonProperty("name") - private String name; - - // - public String getIsoCode() { - return isoCode; - } - - public String getName() { - return name; - } - // - - // - public void setIsoCode(String isoCode) { - this.isoCode = isoCode; - } - - public void setName(String name) { - this.name = name; - } - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final Language other = (Language) obj; - if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) { - return false; - } - if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 71 * hash + (this.isoCode != null ? this.isoCode.hashCode() : 0); - hash = 71 * hash + (this.name != null ? this.name.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author stuart.boston + */ +@JsonRootName("spoken_language") +public class Language implements Serializable { + + private static final long serialVersionUID = 1L; + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(Language.class); + /* + * Properties + */ + @JsonProperty("iso_639_1") + private String isoCode; + @JsonProperty("name") + private String name; + + // + public String getIsoCode() { + return isoCode; + } + + public String getName() { + return name; + } + // + + // + public void setIsoCode(String isoCode) { + this.isoCode = isoCode; + } + + public void setName(String name) { + this.name = name; + } + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Language other = (Language) obj; + if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) { + return false; + } + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 71 * hash + (this.isoCode != null ? this.isoCode.hashCode() : 0); + hash = 71 * hash + (this.name != null ? this.name.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/MovieDb.java b/src/main/java/com/omertron/themoviedbapi/model/MovieDb.java index 644eb164e..13d643fe8 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/MovieDb.java +++ b/src/main/java/com/omertron/themoviedbapi/model/MovieDb.java @@ -447,6 +447,6 @@ public class MovieDb implements Serializable { @Override public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); } } diff --git a/src/main/java/com/omertron/themoviedbapi/model/MovieDbList.java b/src/main/java/com/omertron/themoviedbapi/model/MovieDbList.java index 2c466dd53..d210d9ff2 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/MovieDbList.java +++ b/src/main/java/com/omertron/themoviedbapi/model/MovieDbList.java @@ -1,158 +1,158 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Collections; -import java.util.List; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Wrapper for the MovieDbList function - * - * @author stuart.boston - */ -public class MovieDbList { - /* - * Logger - */ - - private static final Logger LOG = LoggerFactory.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 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; - - // - public String getId() { - return id; - } - - public String getCreatedBy() { - return createdBy; - } - - public String getDescription() { - return description; - } - - public int getFavoriteCount() { - return favoriteCount; - } - - public List getItems() { - return items; - } - - public int getItemCount() { - return itemCount; - } - - public String getLanguage() { - return language; - } - - public String getName() { - return name; - } - - public String getPosterPath() { - return posterPath; - } - // - - // - 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 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; - } - // - - /** - * 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()); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collections; +import java.util.List; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Wrapper for the MovieDbList function + * + * @author stuart.boston + */ +public class MovieDbList { + /* + * Logger + */ + + private static final Logger LOG = LoggerFactory.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 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; + + // + public String getId() { + return id; + } + + public String getCreatedBy() { + return createdBy; + } + + public String getDescription() { + return description; + } + + public int getFavoriteCount() { + return favoriteCount; + } + + public List getItems() { + return items; + } + + public int getItemCount() { + return itemCount; + } + + public String getLanguage() { + return language; + } + + public String getName() { + return name; + } + + public String getPosterPath() { + return posterPath; + } + // + + // + 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 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; + } + // + + /** + * 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()); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/MovieList.java b/src/main/java/com/omertron/themoviedbapi/model/MovieList.java index 63a1586a6..d1ec9db84 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/MovieList.java +++ b/src/main/java/com/omertron/themoviedbapi/model/MovieList.java @@ -1,148 +1,148 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class MovieList implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.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; - @JsonProperty("list_type") - private String listType; - - // - 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; - } - - public String getListType() { - return listType; - } - // - - // - 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; - } - - public void setListType(String listType) { - this.listType = listType; - } - // - - /** - * 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()); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Stuart + */ +public class MovieList implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.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; + @JsonProperty("list_type") + private String listType; + + // + 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; + } + + public String getListType() { + return listType; + } + // + + // + 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; + } + + public void setListType(String listType) { + this.listType = listType; + } + // + + /** + * 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()); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/Person.java b/src/main/java/com/omertron/themoviedbapi/model/Person.java index 478cdae3f..8bd68e6e7 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/Person.java +++ b/src/main/java/com/omertron/themoviedbapi/model/Person.java @@ -1,329 +1,329 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -public class Person implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(Person.class); - - /* - * Static fields for default cast information - */ - private static final String CAST_DEPARTMENT = "acting"; - private static final String CAST_JOB = "actor"; - private static final String DEFAULT_STRING = ""; - /* - * Properties - */ - @JsonProperty("id") - private int id = -1; - @JsonProperty("name") - private String name = ""; - @JsonProperty("profile_path") - private String profilePath = DEFAULT_STRING; - private PersonType personType = PersonType.PERSON; - private String department = DEFAULT_STRING; // Crew - private String job = DEFAULT_STRING; // Crew - private String character = DEFAULT_STRING; // Cast - private int order = -1; // Cast - @JsonProperty("adult") - private boolean adult = false; // Person info - @JsonProperty("also_known_as") - private List aka = new ArrayList(); - @JsonProperty("biography") - private String biography = DEFAULT_STRING; - @JsonProperty("birthday") - private String birthday = DEFAULT_STRING; - @JsonProperty("deathday") - private String deathday = DEFAULT_STRING; - @JsonProperty("homepage") - private String homepage = DEFAULT_STRING; - @JsonProperty("place_of_birth") - private String birthplace = DEFAULT_STRING; - @JsonProperty("imdb_id") - private String imdbId = DEFAULT_STRING; - @JsonProperty("popularity") - private float popularity = 0.0f; - - /** - * Add a crew member - * - * @param id - * @param name - * @param profilePath - * @param department - * @param job - */ - public void addCrew(int id, String name, String profilePath, String department, String job) { - setPersonType(PersonType.CREW); - setId(id); - setName(name); - setProfilePath(profilePath); - setDepartment(department); - setJob(job); - setCharacter(""); - setOrder(-1); - } - - /** - * Add a cast member - * - * @param id - * @param name - * @param profilePath - * @param character - * @param order - */ - public void addCast(int id, String name, String profilePath, String character, int order) { - setPersonType(PersonType.CAST); - setId(id); - setName(name); - setProfilePath(profilePath); - setCharacter(character); - setOrder(order); - setDepartment(CAST_DEPARTMENT); - setJob(CAST_JOB); - } - - // - public String getCharacter() { - return character; - } - - public String getDepartment() { - return department; - } - - public int getId() { - return id; - } - - public String getJob() { - return job; - } - - public String getName() { - return name; - } - - public int getOrder() { - return order; - } - - public PersonType getPersonType() { - return personType; - } - - public String getProfilePath() { - return profilePath; - } - - public boolean isAdult() { - return adult; - } - - public List getAka() { - return aka; - } - - public String getBiography() { - return biography; - } - - public String getBirthday() { - return birthday; - } - - public String getBirthplace() { - return birthplace; - } - - public String getDeathday() { - return deathday; - } - - public String getHomepage() { - return homepage; - } - - public String getImdbId() { - return imdbId; - } - - public float getPopularity() { - return popularity; - } - // - - // - public void setCharacter(String character) { - this.character = character; - } - - public void setDepartment(String department) { - this.department = department; - } - - public void setId(int id) { - this.id = id; - } - - public void setJob(String job) { - this.job = StringUtils.trimToEmpty(job); - } - - public void setName(String name) { - this.name = StringUtils.trimToEmpty(name); - } - - public void setOrder(int order) { - this.order = order; - } - - public void setPersonType(PersonType personType) { - this.personType = personType; - } - - public void setProfilePath(String profilePath) { - this.profilePath = StringUtils.trimToEmpty(profilePath); - } - - public void setAdult(boolean adult) { - this.adult = adult; - } - - public void setAka(List aka) { - this.aka = aka; - } - - public void setBiography(String biography) { - this.biography = StringUtils.trimToEmpty(biography); - } - - public void setBirthday(String birthday) { - this.birthday = StringUtils.trimToEmpty(birthday); - } - - public void setBirthplace(String birthplace) { - this.birthplace = StringUtils.trimToEmpty(birthplace); - } - - public void setDeathday(String deathday) { - this.deathday = StringUtils.trimToEmpty(deathday); - } - - public void setHomepage(String homepage) { - this.homepage = StringUtils.trimToEmpty(homepage); - } - - public void setImdbId(String imdbId) { - this.imdbId = StringUtils.trimToEmpty(imdbId); - } - - public void setPopularity(float popularity) { - this.popularity = popularity; - } - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final Person other = (Person) obj; - if (this.id != other.id) { - return false; - } - if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { - return false; - } - if ((this.profilePath == null) ? (other.profilePath != null) : !this.profilePath.equals(other.profilePath)) { - return false; - } - if (this.personType != other.personType) { - return false; - } - if ((this.department == null) ? (other.department != null) : !this.department.equals(other.department)) { - return false; - } - if ((this.job == null) ? (other.job != null) : !this.job.equals(other.job)) { - return false; - } - if ((this.character == null) ? (other.character != null) : !this.character.equals(other.character)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 3; - hash = 37 * hash + this.id; - hash = 37 * hash + (this.name != null ? this.name.hashCode() : 0); - hash = 37 * hash + (this.profilePath != null ? this.profilePath.hashCode() : 0); - hash = 37 * hash + (this.personType != null ? this.personType.hashCode() : 0); - hash = 37 * hash + (this.department != null ? this.department.hashCode() : 0); - hash = 37 * hash + (this.job != null ? this.job.hashCode() : 0); - hash = 37 * hash + (this.character != null ? this.character.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author stuart.boston + */ +public class Person implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(Person.class); + + /* + * Static fields for default cast information + */ + private static final String CAST_DEPARTMENT = "acting"; + private static final String CAST_JOB = "actor"; + private static final String DEFAULT_STRING = ""; + /* + * Properties + */ + @JsonProperty("id") + private int id = -1; + @JsonProperty("name") + private String name = ""; + @JsonProperty("profile_path") + private String profilePath = DEFAULT_STRING; + private PersonType personType = PersonType.PERSON; + private String department = DEFAULT_STRING; // Crew + private String job = DEFAULT_STRING; // Crew + private String character = DEFAULT_STRING; // Cast + private int order = -1; // Cast + @JsonProperty("adult") + private boolean adult = false; // Person info + @JsonProperty("also_known_as") + private List aka = new ArrayList(); + @JsonProperty("biography") + private String biography = DEFAULT_STRING; + @JsonProperty("birthday") + private String birthday = DEFAULT_STRING; + @JsonProperty("deathday") + private String deathday = DEFAULT_STRING; + @JsonProperty("homepage") + private String homepage = DEFAULT_STRING; + @JsonProperty("place_of_birth") + private String birthplace = DEFAULT_STRING; + @JsonProperty("imdb_id") + private String imdbId = DEFAULT_STRING; + @JsonProperty("popularity") + private float popularity = 0.0f; + + /** + * Add a crew member + * + * @param id + * @param name + * @param profilePath + * @param department + * @param job + */ + public void addCrew(int id, String name, String profilePath, String department, String job) { + setPersonType(PersonType.CREW); + setId(id); + setName(name); + setProfilePath(profilePath); + setDepartment(department); + setJob(job); + setCharacter(""); + setOrder(-1); + } + + /** + * Add a cast member + * + * @param id + * @param name + * @param profilePath + * @param character + * @param order + */ + public void addCast(int id, String name, String profilePath, String character, int order) { + setPersonType(PersonType.CAST); + setId(id); + setName(name); + setProfilePath(profilePath); + setCharacter(character); + setOrder(order); + setDepartment(CAST_DEPARTMENT); + setJob(CAST_JOB); + } + + // + public String getCharacter() { + return character; + } + + public String getDepartment() { + return department; + } + + public int getId() { + return id; + } + + public String getJob() { + return job; + } + + public String getName() { + return name; + } + + public int getOrder() { + return order; + } + + public PersonType getPersonType() { + return personType; + } + + public String getProfilePath() { + return profilePath; + } + + public boolean isAdult() { + return adult; + } + + public List getAka() { + return aka; + } + + public String getBiography() { + return biography; + } + + public String getBirthday() { + return birthday; + } + + public String getBirthplace() { + return birthplace; + } + + public String getDeathday() { + return deathday; + } + + public String getHomepage() { + return homepage; + } + + public String getImdbId() { + return imdbId; + } + + public float getPopularity() { + return popularity; + } + // + + // + public void setCharacter(String character) { + this.character = character; + } + + public void setDepartment(String department) { + this.department = department; + } + + public void setId(int id) { + this.id = id; + } + + public void setJob(String job) { + this.job = StringUtils.trimToEmpty(job); + } + + public void setName(String name) { + this.name = StringUtils.trimToEmpty(name); + } + + public void setOrder(int order) { + this.order = order; + } + + public void setPersonType(PersonType personType) { + this.personType = personType; + } + + public void setProfilePath(String profilePath) { + this.profilePath = StringUtils.trimToEmpty(profilePath); + } + + public void setAdult(boolean adult) { + this.adult = adult; + } + + public void setAka(List aka) { + this.aka = aka; + } + + public void setBiography(String biography) { + this.biography = StringUtils.trimToEmpty(biography); + } + + public void setBirthday(String birthday) { + this.birthday = StringUtils.trimToEmpty(birthday); + } + + public void setBirthplace(String birthplace) { + this.birthplace = StringUtils.trimToEmpty(birthplace); + } + + public void setDeathday(String deathday) { + this.deathday = StringUtils.trimToEmpty(deathday); + } + + public void setHomepage(String homepage) { + this.homepage = StringUtils.trimToEmpty(homepage); + } + + public void setImdbId(String imdbId) { + this.imdbId = StringUtils.trimToEmpty(imdbId); + } + + public void setPopularity(float popularity) { + this.popularity = popularity; + } + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Person other = (Person) obj; + if (this.id != other.id) { + return false; + } + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + return false; + } + if ((this.profilePath == null) ? (other.profilePath != null) : !this.profilePath.equals(other.profilePath)) { + return false; + } + if (this.personType != other.personType) { + return false; + } + if ((this.department == null) ? (other.department != null) : !this.department.equals(other.department)) { + return false; + } + if ((this.job == null) ? (other.job != null) : !this.job.equals(other.job)) { + return false; + } + if ((this.character == null) ? (other.character != null) : !this.character.equals(other.character)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 37 * hash + this.id; + hash = 37 * hash + (this.name != null ? this.name.hashCode() : 0); + hash = 37 * hash + (this.profilePath != null ? this.profilePath.hashCode() : 0); + hash = 37 * hash + (this.personType != null ? this.personType.hashCode() : 0); + hash = 37 * hash + (this.department != null ? this.department.hashCode() : 0); + hash = 37 * hash + (this.job != null ? this.job.hashCode() : 0); + hash = 37 * hash + (this.character != null ? this.character.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/PersonCast.java b/src/main/java/com/omertron/themoviedbapi/model/PersonCast.java index 48eef9c14..b09ede393 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/PersonCast.java +++ b/src/main/java/com/omertron/themoviedbapi/model/PersonCast.java @@ -1,169 +1,169 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class PersonCast implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(PersonCast.class); - /* - * Properties - */ - @JsonProperty("id") - private int id; - @JsonProperty("character") - private String character; - @JsonProperty("name") - private String name; - @JsonProperty("order") - private int order; - @JsonProperty("profile_path") - private String profilePath; - @JsonProperty("cast_id") - private int castId; - - // - public String getCharacter() { - return character; - } - - public int getId() { - return id; - } - - public String getName() { - return name; - } - - public int getOrder() { - return order; - } - - public String getProfilePath() { - return profilePath; - } - - public int getCastId() { - return castId; - } - - // - - // - public void setCharacter(String character) { - this.character = StringUtils.trimToEmpty(character); - } - - public void setId(int id) { - this.id = id; - } - - public void setName(String name) { - this.name = StringUtils.trimToEmpty(name); - } - - public void setOrder(int order) { - this.order = order; - } - - public void setProfilePath(String profilePath) { - this.profilePath = StringUtils.trimToEmpty(profilePath); - } - - public void setCastId(int castId) { - this.castId = castId; - } - - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final PersonCast other = (PersonCast) obj; - if (this.id != other.id) { - return false; - } - if ((this.character == null) ? (other.character != null) : !this.character.equals(other.character)) { - return false; - } - if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { - return false; - } - if (this.order != other.order) { - return false; - } - if ((this.profilePath == null) ? (other.profilePath != null) : !this.profilePath.equals(other.profilePath)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 41 * hash + this.id; - hash = 41 * hash + (this.character != null ? this.character.hashCode() : 0); - hash = 41 * hash + (this.name != null ? this.name.hashCode() : 0); - hash = 41 * hash + this.order; - hash = 41 * hash + (this.profilePath != null ? this.profilePath.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Stuart + */ +public class PersonCast implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(PersonCast.class); + /* + * Properties + */ + @JsonProperty("id") + private int id; + @JsonProperty("character") + private String character; + @JsonProperty("name") + private String name; + @JsonProperty("order") + private int order; + @JsonProperty("profile_path") + private String profilePath; + @JsonProperty("cast_id") + private int castId; + + // + public String getCharacter() { + return character; + } + + public int getId() { + return id; + } + + public String getName() { + return name; + } + + public int getOrder() { + return order; + } + + public String getProfilePath() { + return profilePath; + } + + public int getCastId() { + return castId; + } + + // + + // + public void setCharacter(String character) { + this.character = StringUtils.trimToEmpty(character); + } + + public void setId(int id) { + this.id = id; + } + + public void setName(String name) { + this.name = StringUtils.trimToEmpty(name); + } + + public void setOrder(int order) { + this.order = order; + } + + public void setProfilePath(String profilePath) { + this.profilePath = StringUtils.trimToEmpty(profilePath); + } + + public void setCastId(int castId) { + this.castId = castId; + } + + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final PersonCast other = (PersonCast) obj; + if (this.id != other.id) { + return false; + } + if ((this.character == null) ? (other.character != null) : !this.character.equals(other.character)) { + return false; + } + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + return false; + } + if (this.order != other.order) { + return false; + } + if ((this.profilePath == null) ? (other.profilePath != null) : !this.profilePath.equals(other.profilePath)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 41 * hash + this.id; + hash = 41 * hash + (this.character != null ? this.character.hashCode() : 0); + hash = 41 * hash + (this.name != null ? this.name.hashCode() : 0); + hash = 41 * hash + this.order; + hash = 41 * hash + (this.profilePath != null ? this.profilePath.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/PersonCredit.java b/src/main/java/com/omertron/themoviedbapi/model/PersonCredit.java index cebcac84f..d3ec16190 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/PersonCredit.java +++ b/src/main/java/com/omertron/themoviedbapi/model/PersonCredit.java @@ -1,169 +1,169 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -public class PersonCredit implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(PersonCredit.class); - private static final String DEFAULT_STRING = ""; - /* - * Properties - */ - @JsonProperty("id") - private int movieId = 0; - @JsonProperty("character") - private String character = DEFAULT_STRING; - @JsonProperty("original_title") - private String movieOriginalTitle = DEFAULT_STRING; - @JsonProperty("poster_path") - private String posterPath = DEFAULT_STRING; - @JsonProperty("release_date") - private String releaseDate = DEFAULT_STRING; - @JsonProperty("title") - private String movieTitle = DEFAULT_STRING; - @JsonProperty("department") - private String department = DEFAULT_STRING; - @JsonProperty("job") - private String job = DEFAULT_STRING; - @JsonProperty("adult") - private String adult = DEFAULT_STRING; - private PersonType personType = PersonType.PERSON; - - // - public String getCharacter() { - return character; - } - - public String getDepartment() { - return department; - } - - public String getJob() { - return job; - } - - public int getMovieId() { - return movieId; - } - - public String getMovieOriginalTitle() { - return movieOriginalTitle; - } - - public String getMovieTitle() { - return movieTitle; - } - - public PersonType getPersonType() { - return personType; - } - - public String getPosterPath() { - return posterPath; - } - - public String getReleaseDate() { - return releaseDate; - } - - public String getAdult() { - return adult; - } - // - - // - public void setCharacter(String character) { - this.character = StringUtils.trimToEmpty(character); - } - - public void setDepartment(String department) { - this.department = StringUtils.trimToEmpty(department); - } - - public void setJob(String job) { - this.job = StringUtils.trimToEmpty(job); - } - - public void setMovieId(int movieId) { - this.movieId = movieId; - } - - public void setMovieOriginalTitle(String movieOriginalTitle) { - this.movieOriginalTitle = StringUtils.trimToEmpty(movieOriginalTitle); - } - - public void setMovieTitle(String movieTitle) { - this.movieTitle = StringUtils.trimToEmpty(movieTitle); - } - - public void setPersonType(PersonType personType) { - this.personType = personType; - } - - public void setPosterPath(String posterPath) { - this.posterPath = StringUtils.trimToEmpty(posterPath); - } - - public void setReleaseDate(String releaseDate) { - this.releaseDate = StringUtils.trimToEmpty(releaseDate); - } - - public void setAdult(String adult) { - this.adult = StringUtils.trimToEmpty(adult); - } - // - - /** - * 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()); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author stuart.boston + */ +public class PersonCredit implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(PersonCredit.class); + private static final String DEFAULT_STRING = ""; + /* + * Properties + */ + @JsonProperty("id") + private int movieId = 0; + @JsonProperty("character") + private String character = DEFAULT_STRING; + @JsonProperty("original_title") + private String movieOriginalTitle = DEFAULT_STRING; + @JsonProperty("poster_path") + private String posterPath = DEFAULT_STRING; + @JsonProperty("release_date") + private String releaseDate = DEFAULT_STRING; + @JsonProperty("title") + private String movieTitle = DEFAULT_STRING; + @JsonProperty("department") + private String department = DEFAULT_STRING; + @JsonProperty("job") + private String job = DEFAULT_STRING; + @JsonProperty("adult") + private String adult = DEFAULT_STRING; + private PersonType personType = PersonType.PERSON; + + // + public String getCharacter() { + return character; + } + + public String getDepartment() { + return department; + } + + public String getJob() { + return job; + } + + public int getMovieId() { + return movieId; + } + + public String getMovieOriginalTitle() { + return movieOriginalTitle; + } + + public String getMovieTitle() { + return movieTitle; + } + + public PersonType getPersonType() { + return personType; + } + + public String getPosterPath() { + return posterPath; + } + + public String getReleaseDate() { + return releaseDate; + } + + public String getAdult() { + return adult; + } + // + + // + public void setCharacter(String character) { + this.character = StringUtils.trimToEmpty(character); + } + + public void setDepartment(String department) { + this.department = StringUtils.trimToEmpty(department); + } + + public void setJob(String job) { + this.job = StringUtils.trimToEmpty(job); + } + + public void setMovieId(int movieId) { + this.movieId = movieId; + } + + public void setMovieOriginalTitle(String movieOriginalTitle) { + this.movieOriginalTitle = StringUtils.trimToEmpty(movieOriginalTitle); + } + + public void setMovieTitle(String movieTitle) { + this.movieTitle = StringUtils.trimToEmpty(movieTitle); + } + + public void setPersonType(PersonType personType) { + this.personType = personType; + } + + public void setPosterPath(String posterPath) { + this.posterPath = StringUtils.trimToEmpty(posterPath); + } + + public void setReleaseDate(String releaseDate) { + this.releaseDate = StringUtils.trimToEmpty(releaseDate); + } + + public void setAdult(String adult) { + this.adult = StringUtils.trimToEmpty(adult); + } + // + + /** + * 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()); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/PersonCrew.java b/src/main/java/com/omertron/themoviedbapi/model/PersonCrew.java index dd27a13d1..ca1fcd29c 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/PersonCrew.java +++ b/src/main/java/com/omertron/themoviedbapi/model/PersonCrew.java @@ -1,154 +1,154 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class PersonCrew implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(PersonCrew.class); - /* - * Properties - */ - @JsonProperty("id") - private int id; - @JsonProperty("department") - private String department; - @JsonProperty("job") - private String job; - @JsonProperty("name") - private String name; - @JsonProperty("profile_path") - private String profilePath; - - // - public String getDepartment() { - return department; - } - - public int getId() { - return id; - } - - public String getJob() { - return job; - } - - public String getName() { - return name; - } - - public String getProfilePath() { - return profilePath; - } - // - - // - public void setDepartment(String department) { - this.department = StringUtils.trimToEmpty(department); - } - - public void setId(int id) { - this.id = id; - } - - public void setJob(String job) { - this.job = StringUtils.trimToEmpty(job); - } - - public void setName(String name) { - this.name = StringUtils.trimToEmpty(name); - } - - public void setProfilePath(String profilePath) { - this.profilePath = StringUtils.trimToEmpty(profilePath); - } - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final PersonCrew other = (PersonCrew) obj; - if (this.id != other.id) { - return false; - } - if ((this.department == null) ? (other.department != null) : !this.department.equals(other.department)) { - return false; - } - if ((this.job == null) ? (other.job != null) : !this.job.equals(other.job)) { - return false; - } - if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 59 * hash + this.id; - hash = 59 * hash + (this.department != null ? this.department.hashCode() : 0); - hash = 59 * hash + (this.job != null ? this.job.hashCode() : 0); - hash = 59 * hash + (this.name != null ? this.name.hashCode() : 0); - hash = 59 * hash + (this.profilePath != null ? this.profilePath.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Stuart + */ +public class PersonCrew implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(PersonCrew.class); + /* + * Properties + */ + @JsonProperty("id") + private int id; + @JsonProperty("department") + private String department; + @JsonProperty("job") + private String job; + @JsonProperty("name") + private String name; + @JsonProperty("profile_path") + private String profilePath; + + // + public String getDepartment() { + return department; + } + + public int getId() { + return id; + } + + public String getJob() { + return job; + } + + public String getName() { + return name; + } + + public String getProfilePath() { + return profilePath; + } + // + + // + public void setDepartment(String department) { + this.department = StringUtils.trimToEmpty(department); + } + + public void setId(int id) { + this.id = id; + } + + public void setJob(String job) { + this.job = StringUtils.trimToEmpty(job); + } + + public void setName(String name) { + this.name = StringUtils.trimToEmpty(name); + } + + public void setProfilePath(String profilePath) { + this.profilePath = StringUtils.trimToEmpty(profilePath); + } + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final PersonCrew other = (PersonCrew) obj; + if (this.id != other.id) { + return false; + } + if ((this.department == null) ? (other.department != null) : !this.department.equals(other.department)) { + return false; + } + if ((this.job == null) ? (other.job != null) : !this.job.equals(other.job)) { + return false; + } + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 59 * hash + this.id; + hash = 59 * hash + (this.department != null ? this.department.hashCode() : 0); + hash = 59 * hash + (this.job != null ? this.job.hashCode() : 0); + hash = 59 * hash + (this.name != null ? this.name.hashCode() : 0); + hash = 59 * hash + (this.profilePath != null ? this.profilePath.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/ProductionCompany.java b/src/main/java/com/omertron/themoviedbapi/model/ProductionCompany.java index dd5e00ef7..a36c8a1ff 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/ProductionCompany.java +++ b/src/main/java/com/omertron/themoviedbapi/model/ProductionCompany.java @@ -1,116 +1,116 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -@JsonRootName("production_company") -public class ProductionCompany implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(ProductionCompany.class); - /* - * Properties - */ - @JsonProperty("id") - private int id; - @JsonProperty("name") - private String name; - - // - public int getId() { - return id; - } - - public String getName() { - return name; - } - // - - // - public void setId(int id) { - this.id = id; - } - - public void setName(String name) { - this.name = name; - } - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final ProductionCompany other = (ProductionCompany) obj; - if (this.id != other.id) { - return false; - } - if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 5; - hash = 37 * hash + this.id; - hash = 37 * hash + (this.name != null ? this.name.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author stuart.boston + */ +@JsonRootName("production_company") +public class ProductionCompany implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(ProductionCompany.class); + /* + * Properties + */ + @JsonProperty("id") + private int id; + @JsonProperty("name") + private String name; + + // + public int getId() { + return id; + } + + public String getName() { + return name; + } + // + + // + public void setId(int id) { + this.id = id; + } + + public void setName(String name) { + this.name = name; + } + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final ProductionCompany other = (ProductionCompany) obj; + if (this.id != other.id) { + return false; + } + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 37 * hash + this.id; + hash = 37 * hash + (this.name != null ? this.name.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/ProductionCountry.java b/src/main/java/com/omertron/themoviedbapi/model/ProductionCountry.java index 6c0a73030..4e084fa90 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/ProductionCountry.java +++ b/src/main/java/com/omertron/themoviedbapi/model/ProductionCountry.java @@ -1,116 +1,116 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -@JsonRootName("production_country") -public class ProductionCountry implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(ProductionCountry.class); - /* - * Properties - */ - @JsonProperty("iso_3166_1") - private String isoCode; - @JsonProperty("name") - private String name; - - // - public String getIsoCode() { - return isoCode; - } - - public String getName() { - return name; - } - // - - // - public void setIsoCode(String isoCode) { - this.isoCode = isoCode; - } - - public void setName(String name) { - this.name = name; - } - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final ProductionCountry other = (ProductionCountry) obj; - if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) { - return false; - } - if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 47 * hash + (this.isoCode != null ? this.isoCode.hashCode() : 0); - hash = 47 * hash + (this.name != null ? this.name.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author stuart.boston + */ +@JsonRootName("production_country") +public class ProductionCountry implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(ProductionCountry.class); + /* + * Properties + */ + @JsonProperty("iso_3166_1") + private String isoCode; + @JsonProperty("name") + private String name; + + // + public String getIsoCode() { + return isoCode; + } + + public String getName() { + return name; + } + // + + // + public void setIsoCode(String isoCode) { + this.isoCode = isoCode; + } + + public void setName(String name) { + this.name = name; + } + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final ProductionCountry other = (ProductionCountry) obj; + if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) { + return false; + } + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 47 * hash + (this.isoCode != null ? this.isoCode.hashCode() : 0); + hash = 47 * hash + (this.name != null ? this.name.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/ReleaseInfo.java b/src/main/java/com/omertron/themoviedbapi/model/ReleaseInfo.java index d667d305e..c5c94d203 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/ReleaseInfo.java +++ b/src/main/java/com/omertron/themoviedbapi/model/ReleaseInfo.java @@ -1,128 +1,128 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class ReleaseInfo implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(ReleaseInfo.class); - /* - * Properties - */ - @JsonProperty("iso_3166_1") - private String country; - @JsonProperty("certification") - private String certification; - @JsonProperty("release_date") - private String releaseDate; - - // - public String getCertification() { - return certification; - } - - public String getCountry() { - return country; - } - - public String getReleaseDate() { - return releaseDate; - } - // - - // - public void setCertification(String certification) { - this.certification = certification; - } - - public void setCountry(String country) { - this.country = country; - } - - public void setReleaseDate(String releaseDate) { - this.releaseDate = releaseDate; - } - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final ReleaseInfo other = (ReleaseInfo) obj; - if ((this.country == null) ? (other.country != null) : !this.country.equals(other.country)) { - return false; - } - if ((this.certification == null) ? (other.certification != null) : !this.certification.equals(other.certification)) { - return false; - } - if ((this.releaseDate == null) ? (other.releaseDate != null) : !this.releaseDate.equals(other.releaseDate)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 3; - hash = 89 * hash + (this.country != null ? this.country.hashCode() : 0); - hash = 89 * hash + (this.certification != null ? this.certification.hashCode() : 0); - hash = 89 * hash + (this.releaseDate != null ? this.releaseDate.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Stuart + */ +public class ReleaseInfo implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(ReleaseInfo.class); + /* + * Properties + */ + @JsonProperty("iso_3166_1") + private String country; + @JsonProperty("certification") + private String certification; + @JsonProperty("release_date") + private String releaseDate; + + // + public String getCertification() { + return certification; + } + + public String getCountry() { + return country; + } + + public String getReleaseDate() { + return releaseDate; + } + // + + // + public void setCertification(String certification) { + this.certification = certification; + } + + public void setCountry(String country) { + this.country = country; + } + + public void setReleaseDate(String releaseDate) { + this.releaseDate = releaseDate; + } + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final ReleaseInfo other = (ReleaseInfo) obj; + if ((this.country == null) ? (other.country != null) : !this.country.equals(other.country)) { + return false; + } + if ((this.certification == null) ? (other.certification != null) : !this.certification.equals(other.certification)) { + return false; + } + if ((this.releaseDate == null) ? (other.releaseDate != null) : !this.releaseDate.equals(other.releaseDate)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 89 * hash + (this.country != null ? this.country.hashCode() : 0); + hash = 89 * hash + (this.certification != null ? this.certification.hashCode() : 0); + hash = 89 * hash + (this.releaseDate != null ? this.releaseDate.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/Reviews.java b/src/main/java/com/omertron/themoviedbapi/model/Reviews.java index 04bafd590..5daf08105 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/Reviews.java +++ b/src/main/java/com/omertron/themoviedbapi/model/Reviews.java @@ -103,6 +103,6 @@ public class Reviews implements Serializable { @Override public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); } } diff --git a/src/main/java/com/omertron/themoviedbapi/model/StatusCode.java b/src/main/java/com/omertron/themoviedbapi/model/StatusCode.java index 7161ef4e3..7a73bcbe4 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/StatusCode.java +++ b/src/main/java/com/omertron/themoviedbapi/model/StatusCode.java @@ -1,88 +1,88 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class StatusCode implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(StatusCode.class); - /* - * Properties - */ - @JsonProperty("status_code") - private int statusCode; - @JsonProperty("status_message") - private String statusMessage; - - // - public int getStatusCode() { - return statusCode; - } - - public void setStatusCode(int statusCode) { - this.statusCode = statusCode; - } - // - - // - public String getStatusMessage() { - return statusMessage; - } - - public void setStatusMessage(String statusMessage) { - this.statusMessage = statusMessage; - } - // - - /** - * 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()); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Stuart + */ +public class StatusCode implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(StatusCode.class); + /* + * Properties + */ + @JsonProperty("status_code") + private int statusCode; + @JsonProperty("status_message") + private String statusMessage; + + // + public int getStatusCode() { + return statusCode; + } + + public void setStatusCode(int statusCode) { + this.statusCode = statusCode; + } + // + + // + public String getStatusMessage() { + return statusMessage; + } + + public void setStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + } + // + + /** + * 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()); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/TmdbConfiguration.java b/src/main/java/com/omertron/themoviedbapi/model/TmdbConfiguration.java index a5dc721c3..555c04834 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/TmdbConfiguration.java +++ b/src/main/java/com/omertron/themoviedbapi/model/TmdbConfiguration.java @@ -1,202 +1,202 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import java.util.List; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author stuart.boston - */ -public class TmdbConfiguration implements Serializable { - - private static final long serialVersionUID = 1L; - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(TmdbConfiguration.class); - /* - * Properties - */ - @JsonProperty("base_url") - private String baseUrl; - @JsonProperty("secure_base_url") - private String secureBaseUrl; - @JsonProperty("poster_sizes") - private List posterSizes; - @JsonProperty("backdrop_sizes") - private List backdropSizes; - @JsonProperty("profile_sizes") - private List profileSizes; - @JsonProperty("logo_sizes") - private List logoSizes; - - // //GEN-BEGIN:getterMethods - public List getBackdropSizes() { - return backdropSizes; - } - - public String getBaseUrl() { - return baseUrl; - } - - public List getPosterSizes() { - return posterSizes; - } - - public List getProfileSizes() { - return profileSizes; - } - - public List getLogoSizes() { - return logoSizes; - } - - public String getSecureBaseUrl() { - return secureBaseUrl; - } - - // - // //GEN-BEGIN:setterMethods - public void setBackdropSizes(List backdropSizes) { - this.backdropSizes = backdropSizes; - } - - public void setBaseUrl(String baseUrl) { - this.baseUrl = baseUrl; - } - - public void setPosterSizes(List posterSizes) { - this.posterSizes = posterSizes; - } - - public void setProfileSizes(List profileSizes) { - this.profileSizes = profileSizes; - } - - public void setLogoSizes(List logoSizes) { - this.logoSizes = logoSizes; - } - - public void setSecureBaseUrl(String secureBaseUrl) { - this.secureBaseUrl = secureBaseUrl; - } - // - - /** - * Copy the data from the passed object to this one - * - * @param config - */ - public void clone(TmdbConfiguration config) { - backdropSizes = config.getBackdropSizes(); - baseUrl = config.getBaseUrl(); - posterSizes = config.getPosterSizes(); - profileSizes = config.getProfileSizes(); - logoSizes = config.getLogoSizes(); - } - - /** - * Check that the poster size is valid - * - * @param posterSize - */ - public boolean isValidPosterSize(String posterSize) { - if (StringUtils.isBlank(posterSize) || posterSizes.isEmpty()) { - return false; - } - return posterSizes.contains(posterSize); - } - - /** - * Check that the backdrop size is valid - * - * @param backdropSize - */ - public boolean isValidBackdropSize(String backdropSize) { - if (StringUtils.isBlank(backdropSize) || backdropSizes.isEmpty()) { - return false; - } - return backdropSizes.contains(backdropSize); - } - - /** - * Check that the profile size is valid - * - * @param profileSize - */ - public boolean isValidProfileSize(String profileSize) { - if (StringUtils.isBlank(profileSize) || profileSizes.isEmpty()) { - return false; - } - return profileSizes.contains(profileSize); - } - - /** - * Check that the logo size is valid - * - * @param logoSize - */ - public boolean isValidLogoSize(String logoSize) { - if (StringUtils.isBlank(logoSize) || logoSizes.isEmpty()) { - return false; - } - return logoSizes.contains(logoSize); - } - - /** - * Check to see if the size is valid for any of the images types - * - * @param sizeToCheck - */ - public boolean isValidSize(String sizeToCheck) { - return (isValidPosterSize(sizeToCheck) - || isValidBackdropSize(sizeToCheck) - || isValidProfileSize(sizeToCheck) - || isValidLogoSize(sizeToCheck)); - } - - /** - * 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()); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import java.util.List; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author stuart.boston + */ +public class TmdbConfiguration implements Serializable { + + private static final long serialVersionUID = 1L; + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(TmdbConfiguration.class); + /* + * Properties + */ + @JsonProperty("base_url") + private String baseUrl; + @JsonProperty("secure_base_url") + private String secureBaseUrl; + @JsonProperty("poster_sizes") + private List posterSizes; + @JsonProperty("backdrop_sizes") + private List backdropSizes; + @JsonProperty("profile_sizes") + private List profileSizes; + @JsonProperty("logo_sizes") + private List logoSizes; + + // //GEN-BEGIN:getterMethods + public List getBackdropSizes() { + return backdropSizes; + } + + public String getBaseUrl() { + return baseUrl; + } + + public List getPosterSizes() { + return posterSizes; + } + + public List getProfileSizes() { + return profileSizes; + } + + public List getLogoSizes() { + return logoSizes; + } + + public String getSecureBaseUrl() { + return secureBaseUrl; + } + + // + // //GEN-BEGIN:setterMethods + public void setBackdropSizes(List backdropSizes) { + this.backdropSizes = backdropSizes; + } + + public void setBaseUrl(String baseUrl) { + this.baseUrl = baseUrl; + } + + public void setPosterSizes(List posterSizes) { + this.posterSizes = posterSizes; + } + + public void setProfileSizes(List profileSizes) { + this.profileSizes = profileSizes; + } + + public void setLogoSizes(List logoSizes) { + this.logoSizes = logoSizes; + } + + public void setSecureBaseUrl(String secureBaseUrl) { + this.secureBaseUrl = secureBaseUrl; + } + // + + /** + * Copy the data from the passed object to this one + * + * @param config + */ + public void clone(TmdbConfiguration config) { + backdropSizes = config.getBackdropSizes(); + baseUrl = config.getBaseUrl(); + posterSizes = config.getPosterSizes(); + profileSizes = config.getProfileSizes(); + logoSizes = config.getLogoSizes(); + } + + /** + * Check that the poster size is valid + * + * @param posterSize + */ + public boolean isValidPosterSize(String posterSize) { + if (StringUtils.isBlank(posterSize) || posterSizes.isEmpty()) { + return false; + } + return posterSizes.contains(posterSize); + } + + /** + * Check that the backdrop size is valid + * + * @param backdropSize + */ + public boolean isValidBackdropSize(String backdropSize) { + if (StringUtils.isBlank(backdropSize) || backdropSizes.isEmpty()) { + return false; + } + return backdropSizes.contains(backdropSize); + } + + /** + * Check that the profile size is valid + * + * @param profileSize + */ + public boolean isValidProfileSize(String profileSize) { + if (StringUtils.isBlank(profileSize) || profileSizes.isEmpty()) { + return false; + } + return profileSizes.contains(profileSize); + } + + /** + * Check that the logo size is valid + * + * @param logoSize + */ + public boolean isValidLogoSize(String logoSize) { + if (StringUtils.isBlank(logoSize) || logoSizes.isEmpty()) { + return false; + } + return logoSizes.contains(logoSize); + } + + /** + * Check to see if the size is valid for any of the images types + * + * @param sizeToCheck + */ + public boolean isValidSize(String sizeToCheck) { + return (isValidPosterSize(sizeToCheck) + || isValidBackdropSize(sizeToCheck) + || isValidProfileSize(sizeToCheck) + || isValidLogoSize(sizeToCheck)); + } + + /** + * 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()); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/TokenAuthorisation.java b/src/main/java/com/omertron/themoviedbapi/model/TokenAuthorisation.java index e7f365bf2..77943648f 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/TokenAuthorisation.java +++ b/src/main/java/com/omertron/themoviedbapi/model/TokenAuthorisation.java @@ -1,91 +1,91 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TokenAuthorisation { - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(TokenAuthorisation.class); - /* - * Properties - */ - @JsonProperty("expires_at") - private String expires; - @JsonProperty("request_token") - private String requestToken; - @JsonProperty("success") - private Boolean success; - - // - public String getExpires() { - return expires; - } - - public String getRequestToken() { - return requestToken; - } - - public Boolean getSuccess() { - return success; - } - // - - // - public void setExpires(String expires) { - this.expires = expires; - } - - public void setRequestToken(String requestToken) { - this.requestToken = requestToken; - } - - public void setSuccess(Boolean success) { - this.success = success; - } - // - - /** - * 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()); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } - -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TokenAuthorisation { + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(TokenAuthorisation.class); + /* + * Properties + */ + @JsonProperty("expires_at") + private String expires; + @JsonProperty("request_token") + private String requestToken; + @JsonProperty("success") + private Boolean success; + + // + public String getExpires() { + return expires; + } + + public String getRequestToken() { + return requestToken; + } + + public Boolean getSuccess() { + return success; + } + // + + // + public void setExpires(String expires) { + this.expires = expires; + } + + public void setRequestToken(String requestToken) { + this.requestToken = requestToken; + } + + public void setSuccess(Boolean success) { + this.success = success; + } + // + + /** + * 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()); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } + +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/TokenSession.java b/src/main/java/com/omertron/themoviedbapi/model/TokenSession.java index 7d1828635..912f2673f 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/TokenSession.java +++ b/src/main/java/com/omertron/themoviedbapi/model/TokenSession.java @@ -1,122 +1,122 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TokenSession { - /* - * Logger - */ - - private static final Logger LOG = LoggerFactory.getLogger(TokenSession.class); - /* - * Properties - */ - @JsonProperty("session_id") - private String sessionId; - @JsonProperty("success") - private Boolean success; - @JsonProperty("status_code") - private String statusCode; - @JsonProperty("status_message") - private String statusMessage; - @JsonProperty("guest_session_id") - private String guestSessionId; - @JsonProperty("expires_at") - private String expiresAt; - - // - public String getSessionId() { - return sessionId; - } - - public Boolean getSuccess() { - return success; - } - - public String getStatusCode() { - return statusCode; - } - - public String getStatusMessage() { - return statusMessage; - } - - public String getGuestSessionId() { - return guestSessionId; - } - - public String getExpiresAt() { - return expiresAt; - } - // - - // - public void setSessionId(String sessionId) { - this.sessionId = sessionId; - } - - public void setSuccess(Boolean success) { - this.success = success; - } - - public void setStatusCode(String statusCode) { - this.statusCode = statusCode; - } - - public void setStatusMessage(String statusMessage) { - this.statusMessage = statusMessage; - } - - public void setGuestSessionId(String guestSessionId) { - this.guestSessionId = guestSessionId; - } - - public void setExpiresAt(String expiresAt) { - this.expiresAt = expiresAt; - } - - // - - /** - * 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()); - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TokenSession { + /* + * Logger + */ + + private static final Logger LOG = LoggerFactory.getLogger(TokenSession.class); + /* + * Properties + */ + @JsonProperty("session_id") + private String sessionId; + @JsonProperty("success") + private Boolean success; + @JsonProperty("status_code") + private String statusCode; + @JsonProperty("status_message") + private String statusMessage; + @JsonProperty("guest_session_id") + private String guestSessionId; + @JsonProperty("expires_at") + private String expiresAt; + + // + public String getSessionId() { + return sessionId; + } + + public Boolean getSuccess() { + return success; + } + + public String getStatusCode() { + return statusCode; + } + + public String getStatusMessage() { + return statusMessage; + } + + public String getGuestSessionId() { + return guestSessionId; + } + + public String getExpiresAt() { + return expiresAt; + } + // + + // + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } + + public void setSuccess(Boolean success) { + this.success = success; + } + + public void setStatusCode(String statusCode) { + this.statusCode = statusCode; + } + + public void setStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + } + + public void setGuestSessionId(String guestSessionId) { + this.guestSessionId = guestSessionId; + } + + public void setExpiresAt(String expiresAt) { + this.expiresAt = expiresAt; + } + + // + + /** + * 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()); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/Trailer.java b/src/main/java/com/omertron/themoviedbapi/model/Trailer.java index e08692ccf..e87282489 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/Trailer.java +++ b/src/main/java/com/omertron/themoviedbapi/model/Trailer.java @@ -1,139 +1,139 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class Trailer implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(Trailer.class); - /* - * Website sources - */ - public static final String WEBSITE_YOUTUBE = "youtube"; - public static final String WEBSITE_QUICKTIME = "quicktime"; - /* - * Properties - */ - private String name; - private String size; - private String source; - private String website; // The website of the trailer - - // - public String getName() { - return name; - } - - public String getSize() { - return size; - } - - public String getSource() { - return source; - } - - public String getWebsite() { - return website; - } - // - - // - public void setName(String name) { - this.name = name; - } - - public void setSize(String size) { - this.size = size; - } - - public void setSource(String source) { - this.source = source; - } - - public void setWebsite(String website) { - this.website = website; - } - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final Trailer other = (Trailer) obj; - if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { - return false; - } - if ((this.size == null) ? (other.size != null) : !this.size.equals(other.size)) { - return false; - } - if ((this.source == null) ? (other.source != null) : !this.source.equals(other.source)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 61 * hash + (this.name != null ? this.name.hashCode() : 0); - hash = 61 * hash + (this.size != null ? this.size.hashCode() : 0); - hash = 61 * hash + (this.source != null ? this.source.hashCode() : 0); - hash = 61 * hash + (this.website != null ? this.website.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Stuart + */ +public class Trailer implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(Trailer.class); + /* + * Website sources + */ + public static final String WEBSITE_YOUTUBE = "youtube"; + public static final String WEBSITE_QUICKTIME = "quicktime"; + /* + * Properties + */ + private String name; + private String size; + private String source; + private String website; // The website of the trailer + + // + public String getName() { + return name; + } + + public String getSize() { + return size; + } + + public String getSource() { + return source; + } + + public String getWebsite() { + return website; + } + // + + // + public void setName(String name) { + this.name = name; + } + + public void setSize(String size) { + this.size = size; + } + + public void setSource(String source) { + this.source = source; + } + + public void setWebsite(String website) { + this.website = website; + } + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Trailer other = (Trailer) obj; + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + return false; + } + if ((this.size == null) ? (other.size != null) : !this.size.equals(other.size)) { + return false; + } + if ((this.source == null) ? (other.source != null) : !this.source.equals(other.source)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 61 * hash + (this.name != null ? this.name.hashCode() : 0); + hash = 61 * hash + (this.size != null ? this.size.hashCode() : 0); + hash = 61 * hash + (this.source != null ? this.source.hashCode() : 0); + hash = 61 * hash + (this.website != null ? this.website.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +} diff --git a/src/main/java/com/omertron/themoviedbapi/model/Translation.java b/src/main/java/com/omertron/themoviedbapi/model/Translation.java index 5640a4e51..c7da8f322 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/Translation.java +++ b/src/main/java/com/omertron/themoviedbapi/model/Translation.java @@ -1,128 +1,128 @@ -/* - * 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.model; - -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author Stuart - */ -public class Translation implements Serializable { - - private static final long serialVersionUID = 1L; - - /* - * Logger - */ - private static final Logger LOG = LoggerFactory.getLogger(Translation.class); - /* - * Properties - */ - @JsonProperty("english_name") - private String englishName; - @JsonProperty("iso_639_1") - private String isoCode; - @JsonProperty("name") - private String name; - - // - public String getEnglishName() { - return englishName; - } - - public String getIsoCode() { - return isoCode; - } - - public String getName() { - return name; - } - // - - // - public void setEnglishName(String englishName) { - this.englishName = englishName; - } - - public void setIsoCode(String isoCode) { - this.isoCode = isoCode; - } - - public void setName(String name) { - this.name = name; - } - // - - /** - * 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()); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final Translation other = (Translation) obj; - if ((this.englishName == null) ? (other.englishName != null) : !this.englishName.equals(other.englishName)) { - return false; - } - if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) { - return false; - } - if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 3; - hash = 29 * hash + (this.englishName != null ? this.englishName.hashCode() : 0); - hash = 29 * hash + (this.isoCode != null ? this.isoCode.hashCode() : 0); - hash = 29 * hash + (this.name != null ? this.name.hashCode() : 0); - return hash; - } - - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); - } -} +/* + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Stuart + */ +public class Translation implements Serializable { + + private static final long serialVersionUID = 1L; + + /* + * Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(Translation.class); + /* + * Properties + */ + @JsonProperty("english_name") + private String englishName; + @JsonProperty("iso_639_1") + private String isoCode; + @JsonProperty("name") + private String name; + + // + public String getEnglishName() { + return englishName; + } + + public String getIsoCode() { + return isoCode; + } + + public String getName() { + return name; + } + // + + // + public void setEnglishName(String englishName) { + this.englishName = englishName; + } + + public void setIsoCode(String isoCode) { + this.isoCode = isoCode; + } + + public void setName(String name) { + this.name = name; + } + // + + /** + * 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()); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Translation other = (Translation) obj; + if ((this.englishName == null) ? (other.englishName != null) : !this.englishName.equals(other.englishName)) { + return false; + } + if ((this.isoCode == null) ? (other.isoCode != null) : !this.isoCode.equals(other.isoCode)) { + return false; + } + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 29 * hash + (this.englishName != null ? this.englishName.hashCode() : 0); + hash = 29 * hash + (this.isoCode != null ? this.isoCode.hashCode() : 0); + hash = 29 * hash + (this.name != null ? this.name.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE); + } +}