Files
api-themoviedb/src/main/java/com/omertron/themoviedbapi/model/Trailer.java
T
2014-12-30 19:49:30 +00:00

136 lines
3.2 KiB
Java

/*
* Copyright (c) 2004-2015 Stuart Boston
*
* This file is part of TheMovieDB API.
*
* TheMovieDB API is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* TheMovieDB API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
/**
* @author Stuart
*/
public class Trailer extends AbstractJsonMapping {
private static final long serialVersionUID = 1L;
/*
* Website sources
*/
public static final String WEBSITE_YOUTUBE = "youtube";
public static final String WEBSITE_QUICKTIME = "quicktime";
/*
* Properties
*/
private String id;
private String name;
private String size;
private String key;
// The website of the trailer
private String site;
private String type;
@JsonProperty("iso_639_1")
private String language;
public String getId() {
return id;
}
public String getName() {
return name;
}
public String getSize() {
return size;
}
public String getKey() {
return key;
}
public String getSite() {
return site;
}
public String getType() {
return type;
}
public String getLanguage() {
return language;
}
public void setId(String id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setSize(String size) {
this.size = size;
}
public void setKey(String key) {
this.key = key;
}
public void setSite(String site) {
this.site = site;
}
public void setType(String type) {
this.type = type;
}
public void setLanguage(String language) {
this.language = language;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof Trailer) {
final Trailer other = (Trailer) obj;
return new EqualsBuilder()
.append(id, other.id)
.append(name, other.name)
.append(size, other.size)
.append(key, other.key)
.append(language, other.language)
.isEquals();
} else {
return false;
}
}
@Override
public int hashCode() {
return new HashCodeBuilder()
.append(id)
.append(name)
.append(size)
.append(key)
.append(site)
.append(language)
.toHashCode();
}
}