Skip to content

Instantly share code, notes, and snippets.

@TripleFrequency
Last active March 31, 2018 03:57
Show Gist options
  • Save TripleFrequency/a45a61a8a1276197e7be0f71dbe466f3 to your computer and use it in GitHub Desktop.
Save TripleFrequency/a45a61a8a1276197e7be0f71dbe466f3 to your computer and use it in GitHub Desktop.
package media.thehoard.thirdparty.api.trakt.objects.get.shows.implementations;
import com.google.gson.annotations.SerializedName;
import media.thehoard.thirdparty.api.trakt.enums.TraktShowStatus;
import media.thehoard.thirdparty.api.trakt.objects.get.shows.TraktShowAirs;
import media.thehoard.thirdparty.api.trakt.objects.get.shows.TraktShowExtended;
import java.time.Instant;
import java.util.List;
public class TraktShowExtendedImpl implements TraktShowExtended {
private String title;
private Integer year;
private TraktShowIdsImpl ids;
private String overview;
@SerializedName("first_aired")
private Instant firstAired;
private TraktShowAirsImpl airs;
private Integer runtime;
//TODO Look into Enum here
private String certification;
private String network;
private String country;
@SerializedName("updated_at")
private Instant updatedAt;
private String trailer;
private String homepage;
private TraktShowStatus status;
private Float rating;
private Integer votes;
@SerializedName("comment_count")
private Integer commentCount;
//TODO Switch to language Enum
private String language;
//TODO Enum
@SerializedName("available_translations")
private List<String> availableTranslations;
private List<String> genres;
@SerializedName("aired_episodes")
private Integer airedEpisodes;
@Override
public String getTitle() {
return title;
}
@Override
public void setTitle(String title) {
this.title = title;
}
@Override
public TraktShowExtended withTitle(String title) {
this.title = title;
return this;
}
@Override
public Integer getYear() {
return year;
}
@Override
public void setYear(Integer year) {
this.year = year;
}
@Override
public TraktShowExtended withYear(Integer year) {
this.year = year;
return this;
}
@Override
public TraktShowIdsImpl getIds() {
return ids;
}
@Override
public void setIds(TraktShowIdsImpl ids) {
this.ids = ids;
}
@Override
public TraktShowExtended withIds(TraktShowIdsImpl ids) {
this.ids = ids;
return this;
}
@Override
public String getOverview() {
return overview;
}
@Override
public void setOverview(String overview) {
this.overview = overview;
}
@Override
public TraktShowExtended withOverview(String overview) {
this.overview = overview;
return this;
}
@Override
public Instant getFirstAired() {
return firstAired;
}
@Override
public void setFirstAired(Instant firstAired) {
this.firstAired = firstAired;
}
@Override
public TraktShowExtended withFirstAired(Instant firstAired) {
this.firstAired = firstAired;
return this;
}
@Override
public TraktShowAirs getAirs() {
return airs;
}
@Override
public void setAirs(TraktShowAirsImpl airs) {
this.airs = airs;
}
@Override
public TraktShowExtended withAirs(TraktShowAirsImpl airs) {
this.airs = airs;
return this;
}
@Override
public Integer getRuntime() {
return runtime;
}
@Override
public void setRuntime(Integer runtime) {
this.runtime = runtime;
}
@Override
public TraktShowExtended withRuntime(Integer runtime) {
this.runtime = runtime;
return this;
}
@Override
public String getCertification() {
return certification;
}
@Override
public void setCertification(String certification) {
this.certification = certification;
}
@Override
public TraktShowExtended withCertification(String certification) {
this.certification = certification;
return this;
}
@Override
public String getNetwork() {
return network;
}
@Override
public void setNetwork(String network) {
this.network = network;
}
@Override
public TraktShowExtended withNetwork(String network) {
this.network = network;
return this;
}
@Override
public String getCountry() {
return country;
}
@Override
public void setCountry(String country) {
this.country = country;
}
@Override
public TraktShowExtended withCountry(String country) {
this.country = country;
return this;
}
@Override
public Instant getUpdatedAt() {
return updatedAt;
}
@Override
public void setUpdatedAt(Instant updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public TraktShowExtended withUpdatedAt(Instant updatedAt) {
this.updatedAt = updatedAt;
return this;
}
@Override
public String getTrailer() {
return trailer;
}
@Override
public void setTrailer(String trailer) {
this.trailer = trailer;
}
@Override
public TraktShowExtended withTrailer(String trailer) {
this.trailer = trailer;
return this;
}
@Override
public String getHomepage() {
return homepage;
}
@Override
public void setHomepage(String homepage) {
this.homepage = homepage;
}
@Override
public TraktShowExtended withHomepage(String homepage) {
this.homepage = homepage;
return this;
}
@Override
public TraktShowStatus getStatus() {
return status;
}
@Override
public void setStatus(TraktShowStatus status) {
this.status = status;
}
@Override
public TraktShowExtended withStatus(TraktShowStatus status) {
this.status = status;
return this;
}
@Override
public Float getRating() {
return rating;
}
@Override
public void setRating(Float rating) {
this.rating = rating;
}
@Override
public TraktShowExtended withRating(Float rating) {
this.rating = rating;
return this;
}
@Override
public Integer getVotes() {
return votes;
}
@Override
public void setVotes(Integer votes) {
this.votes = votes;
}
@Override
public TraktShowExtended withVotes(Integer votes) {
this.votes = votes;
return this;
}
@Override
public Integer getCommentCount() {
return commentCount;
}
@Override
public void setCommentCount(Integer commentCount) {
this.commentCount = commentCount;
}
@Override
public TraktShowExtended withCommentCount(Integer commentCount) {
this.commentCount = commentCount;
return this;
}
@Override
public String getLanguage() {
return language;
}
@Override
public void setLanguage(String language) {
this.language = language;
}
@Override
public TraktShowExtended withLanguage(String language) {
this.language = language;
return this;
}
@Override
public List<String> getAvailableTranslations() {
return availableTranslations;
}
@Override
public void setAvailableTranslations(List<String> availableTranslations) {
this.availableTranslations = availableTranslations;
}
@Override
public TraktShowExtended withAvailableTranslations(List<String> availableTranslations) {
this.availableTranslations = availableTranslations;
return this;
}
@Override
public List<String> getGenres() {
return genres;
}
@Override
public void setGenres(List<String> genres) {
this.genres = genres;
}
@Override
public TraktShowExtended withGenres(List<String> genres) {
this.genres = genres;
return this;
}
@Override
public Integer getAiredEpisodes() {
return airedEpisodes;
}
@Override
public void setAiredEpisodes(Integer airedEpisodes) {
this.airedEpisodes = airedEpisodes;
}
@Override
public TraktShowExtended withAiredEpisodes(Integer airedEpisodes) {
this.airedEpisodes = airedEpisodes;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TraktShowExtendedFullImpl that = (TraktShowExtendedFullImpl) o;
if (title != null ? !title.equals(that.title) : that.title != null) return false;
if (year != null ? !year.equals(that.year) : that.year != null) return false;
if (ids != null ? !ids.equals(that.ids) : that.ids != null) return false;
if (overview != null ? !overview.equals(that.overview) : that.overview != null) return false;
if (firstAired != null ? !firstAired.equals(that.firstAired) : that.firstAired != null) return false;
if (airs != null ? !airs.equals(that.airs) : that.airs != null) return false;
if (runtime != null ? !runtime.equals(that.runtime) : that.runtime != null) return false;
if (certification != null ? !certification.equals(that.certification) : that.certification != null)
return false;
if (network != null ? !network.equals(that.network) : that.network != null) return false;
if (country != null ? !country.equals(that.country) : that.country != null) return false;
if (updatedAt != null ? !updatedAt.equals(that.updatedAt) : that.updatedAt != null) return false;
if (trailer != null ? !trailer.equals(that.trailer) : that.trailer != null) return false;
if (homepage != null ? !homepage.equals(that.homepage) : that.homepage != null) return false;
if (status != that.status) return false;
if (rating != null ? !rating.equals(that.rating) : that.rating != null) return false;
if (votes != null ? !votes.equals(that.votes) : that.votes != null) return false;
if (commentCount != null ? !commentCount.equals(that.commentCount) : that.commentCount != null) return false;
if (language != null ? !language.equals(that.language) : that.language != null) return false;
if (availableTranslations != null ? !availableTranslations.equals(that.availableTranslations)
: that.availableTranslations != null) return false;
if (genres != null ? !genres.equals(that.genres) : that.genres != null) return false;
return airedEpisodes != null ? airedEpisodes.equals(that.airedEpisodes) : that.airedEpisodes == null;
}
@Override
public int hashCode() {
int result = title != null ? title.hashCode() : 0;
result = 31 * result + (year != null ? year.hashCode() : 0);
result = 31 * result + (ids != null ? ids.hashCode() : 0);
result = 31 * result + (overview != null ? overview.hashCode() : 0);
result = 31 * result + (firstAired != null ? firstAired.hashCode() : 0);
result = 31 * result + (airs != null ? airs.hashCode() : 0);
result = 31 * result + (runtime != null ? runtime.hashCode() : 0);
result = 31 * result + (certification != null ? certification.hashCode() : 0);
result = 31 * result + (network != null ? network.hashCode() : 0);
result = 31 * result + (country != null ? country.hashCode() : 0);
result = 31 * result + (updatedAt != null ? updatedAt.hashCode() : 0);
result = 31 * result + (trailer != null ? trailer.hashCode() : 0);
result = 31 * result + (homepage != null ? homepage.hashCode() : 0);
result = 31 * result + (status != null ? status.hashCode() : 0);
result = 31 * result + (rating != null ? rating.hashCode() : 0);
result = 31 * result + (votes != null ? votes.hashCode() : 0);
result = 31 * result + (commentCount != null ? commentCount.hashCode() : 0);
result = 31 * result + (language != null ? language.hashCode() : 0);
result = 31 * result + (availableTranslations != null ? availableTranslations.hashCode() : 0);
result = 31 * result + (genres != null ? genres.hashCode() : 0);
result = 31 * result + (airedEpisodes != null ? airedEpisodes.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "TraktShowExtendedFullImpl{" + "title='" + title + '\'' + ", year=" + year + ", ids=" + ids + ", overview='" + overview + '\'' + ", firstAired=" + firstAired + ", airs=" + airs + ", runtime=" + runtime + ", certification='" + certification + '\'' + ", network='" + network + '\'' + ", country='" + country + '\'' + ", updatedAt=" + updatedAt + ", trailer='" + trailer + '\'' + ", homepage='" + homepage + '\'' + ", status=" + status + ", rating=" + rating + ", votes=" + votes + ", commentCount=" + commentCount + ", language='" + language + '\'' + ", availableTranslations=" + availableTranslations + ", genres=" + genres + ", airedEpisodes=" + airedEpisodes + '}';
}
@Override
protected Object clone() throws CloneNotSupportedException {
TraktShowExtendedFullImpl clone = (TraktShowExtendedFullImpl) super.clone();
clone.title = title;
clone.year = year;
clone.ids = ids;
clone.overview = overview;
clone.firstAired = firstAired;
clone.airs = airs;
clone.runtime = runtime;
clone.certification = certification;
clone.network = network;
clone.country = country;
clone.updatedAt = updatedAt;
clone.trailer = trailer;
clone.homepage = homepage;
clone.status = status;
clone.rating = rating;
clone.votes = votes;
clone.commentCount = commentCount;
clone.language = language;
clone.availableTranslations = availableTranslations;
clone.genres = genres;
clone.airedEpisodes = airedEpisodes;
return clone;
}
}
package media.thehoard.thirdparty.api.trakt.objects.get.shows.implementations
import com.google.gson.annotations.SerializedName
import media.thehoard.thirdparty.api.trakt.enums.TraktShowStatus
import media.thehoard.thirdparty.api.trakt.objects.get.shows.TraktShow
import media.thehoard.thirdparty.api.trakt.objects.get.shows.TraktShowExtendedFull
import java.time.Instant
data class TraktShowExtendedFullImpl(
override var title: String = "",
override var year: Int? = null,
override var ids: TraktShowIdsImpl = TraktShowIdsImpl(),
override var overview: String = "",
@SerializedName("first_aired")
override var firstAired: Instant? = null,
override var airs: TraktShowAirsImpl = TraktShowAirsImpl(),
override var runtime: Int? = null,
override var certification: String = "",
override var network: String = "",
override var country: String = "",
@SerializedName("updated_at")
override var updatedAt: Instant? = null,
override var trailer: String = "",
override var homepage: String = "",
override var status: TraktShowStatus = TraktShowStatus.UNSPECIFIED,
override var rating: Float? = null,
override var votes: Int? = null,
@SerializedName("comment_count")
override var commentCount: Int? = null,
override var language: String = "",
@SerializedName("available_translations")
override var availableTranslations: List<String> = listOf(),
override var genres: List<String> = listOf(),
@SerializedName("aired_episodes")
override var airedEpisodes: Int? = null
) : TraktShowExtendedFull {
constructor(traktShow: TraktShow) : this(traktShow.title, traktShow.year, traktShow.ids)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment