Use Apace Commons EqualsBuilder and HashCodeBuilder
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -40,25 +42,23 @@ public class AbstractIdName extends AbstractJsonMapping {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj instanceof AbstractIdName) {
|
||||
final AbstractIdName other = (AbstractIdName) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(name, other.name)
|
||||
.append(id, other.id)
|
||||
.isEquals();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final AbstractIdName other = (AbstractIdName) obj;
|
||||
if (this.id != other.id) {
|
||||
return false;
|
||||
}
|
||||
return !(this.name == null ? other.name != null : !this.name.equals(other.name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 5;
|
||||
hash = 37 * hash + this.id;
|
||||
hash = 37 * hash + (this.name != null ? this.name.hashCode() : 0);
|
||||
return hash;
|
||||
return new HashCodeBuilder()
|
||||
.append(id)
|
||||
.append(name)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ package com.omertron.themoviedbapi.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
|
||||
/**
|
||||
* @author Stuart
|
||||
@@ -59,27 +61,22 @@ public class AlternativeTitle implements Serializable {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
if (obj instanceof AlternativeTitle) {
|
||||
final AlternativeTitle other = (AlternativeTitle) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(country, other.country)
|
||||
.append(title, other.title)
|
||||
.isEquals();
|
||||
} else {
|
||||
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;
|
||||
return new HashCodeBuilder()
|
||||
.append(country)
|
||||
.append(title)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* The artwork type information
|
||||
@@ -132,43 +134,30 @@ public class Artwork extends AbstractJsonMapping {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
if (obj instanceof Artwork) {
|
||||
final Artwork other = (Artwork) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(aspectRatio, other.aspectRatio)
|
||||
.append(filePath, other.filePath)
|
||||
.append(language, other.language)
|
||||
.append(height, other.height)
|
||||
.append(width, other.width)
|
||||
.append(artworkType, other.artworkType)
|
||||
.isEquals();
|
||||
} else {
|
||||
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;
|
||||
return new HashCodeBuilder()
|
||||
.append(aspectRatio)
|
||||
.append(filePath)
|
||||
.append(height)
|
||||
.append(width)
|
||||
.append(language)
|
||||
.append(artworkType)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ package com.omertron.themoviedbapi.model;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
|
||||
/**
|
||||
* @author stuart.boston
|
||||
@@ -103,37 +105,28 @@ public class Collection extends AbstractJsonMapping {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
if (obj instanceof Collection) {
|
||||
final Collection other = (Collection) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(id, other.id)
|
||||
.append(name, other.name)
|
||||
.append(title, other.title)
|
||||
.append(backdropPath, other.backdropPath)
|
||||
.isEquals();
|
||||
} else {
|
||||
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;
|
||||
return new HashCodeBuilder()
|
||||
.append(id)
|
||||
.append(backdropPath)
|
||||
.append(title)
|
||||
.append(name)
|
||||
.append(posterPath)
|
||||
.append(releaseDate)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ package com.omertron.themoviedbapi.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
|
||||
/**
|
||||
* @author stuart.boston
|
||||
@@ -55,27 +57,22 @@ public class Language extends AbstractJsonMapping {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
if (obj instanceof Language) {
|
||||
final Language other = (Language) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(isoCode, other.isoCode)
|
||||
.append(name, other.name)
|
||||
.isEquals();
|
||||
} else {
|
||||
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;
|
||||
return new HashCodeBuilder()
|
||||
.append(isoCode)
|
||||
.append(name)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ import com.omertron.themoviedbapi.wrapper.WrapperReviews;
|
||||
import com.omertron.themoviedbapi.wrapper.WrapperTrailers;
|
||||
import com.omertron.themoviedbapi.wrapper.WrapperTranslations;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
|
||||
/**
|
||||
* Movie Bean
|
||||
@@ -397,32 +399,25 @@ public class MovieDb extends AbstractJsonMapping {
|
||||
//<editor-fold defaultstate="collapsed" desc="Equals and HashCode">
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
if (obj instanceof MovieDb) {
|
||||
final MovieDb other = (MovieDb) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(id, other.id)
|
||||
.append(imdbID, other.imdbID)
|
||||
.append(runtime, other.runtime)
|
||||
.isEquals();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final MovieDb other = (MovieDb) obj;
|
||||
if (this.id != other.id) {
|
||||
return false;
|
||||
}
|
||||
if (this.imdbID == null ? other.imdbID != null : !this.imdbID.equals(other.imdbID)) {
|
||||
return false;
|
||||
}
|
||||
if (this.runtime != other.runtime) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 5;
|
||||
hash = 89 * hash + this.id;
|
||||
hash = 89 * hash + (this.imdbID != null ? this.imdbID.hashCode() : 0);
|
||||
hash = 89 * hash + this.runtime;
|
||||
return hash;
|
||||
return new HashCodeBuilder()
|
||||
.append(id)
|
||||
.append(imdbID)
|
||||
.append(runtime)
|
||||
.toHashCode();
|
||||
}
|
||||
// </editor-fold>
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
|
||||
/**
|
||||
* @author stuart.boston
|
||||
@@ -263,47 +265,32 @@ public class Person extends AbstractJsonMapping {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
if (obj instanceof Person) {
|
||||
final Person other = (Person) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(id, other.id)
|
||||
.append(name, other.name)
|
||||
.append(profilePath, other.profilePath)
|
||||
.append(personType, other.personType)
|
||||
.append(department, other.department)
|
||||
.append(job, other.job)
|
||||
.append(character, other.character)
|
||||
.isEquals();
|
||||
} else {
|
||||
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;
|
||||
return new HashCodeBuilder()
|
||||
.append(id)
|
||||
.append(name)
|
||||
.append(profilePath)
|
||||
.append(personType)
|
||||
.append(department)
|
||||
.append(job)
|
||||
.append(character)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ package com.omertron.themoviedbapi.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
|
||||
/**
|
||||
* @author Stuart
|
||||
@@ -105,39 +107,28 @@ public class PersonCast extends AbstractJsonMapping {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
if (obj instanceof PersonCast) {
|
||||
final PersonCast other = (PersonCast) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(id, other.id)
|
||||
.append(name, other.name)
|
||||
.append(character, other.character)
|
||||
.append(order, other.order)
|
||||
.append(profilePath, other.profilePath)
|
||||
.isEquals();
|
||||
} else {
|
||||
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;
|
||||
return new HashCodeBuilder()
|
||||
.append(id)
|
||||
.append(character)
|
||||
.append(name)
|
||||
.append(order)
|
||||
.append(profilePath)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ package com.omertron.themoviedbapi.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
|
||||
/**
|
||||
* @author Stuart
|
||||
@@ -95,36 +97,27 @@ public class PersonCrew extends AbstractJsonMapping {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
if (obj instanceof PersonCrew) {
|
||||
final PersonCrew other = (PersonCrew) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(id, other.id)
|
||||
.append(name, other.name)
|
||||
.append(department, other.department)
|
||||
.append(job, other.job)
|
||||
.isEquals();
|
||||
} else {
|
||||
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;
|
||||
return new HashCodeBuilder()
|
||||
.append(id)
|
||||
.append(department)
|
||||
.append(job)
|
||||
.append(name)
|
||||
.append(profilePath)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ package com.omertron.themoviedbapi.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
|
||||
/**
|
||||
* @author stuart.boston
|
||||
@@ -56,27 +58,22 @@ public class ProductionCountry extends AbstractJsonMapping {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
if (obj instanceof ProductionCountry) {
|
||||
final ProductionCountry other = (ProductionCountry) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(name, other.name)
|
||||
.append(isoCode, other.isoCode)
|
||||
.isEquals();
|
||||
} else {
|
||||
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;
|
||||
return new HashCodeBuilder()
|
||||
.append(isoCode)
|
||||
.append(name)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
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
|
||||
@@ -64,31 +66,24 @@ public class ReleaseInfo extends AbstractJsonMapping {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
if (obj instanceof ReleaseInfo) {
|
||||
final ReleaseInfo other = (ReleaseInfo) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(country, other.country)
|
||||
.append(certification, other.certification)
|
||||
.append(releaseDate, other.releaseDate)
|
||||
.isEquals();
|
||||
} else {
|
||||
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;
|
||||
return new HashCodeBuilder()
|
||||
.append(country)
|
||||
.append(certification)
|
||||
.append(releaseDate)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
*/
|
||||
package com.omertron.themoviedbapi.model;
|
||||
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
|
||||
/**
|
||||
* @author Stuart
|
||||
*/
|
||||
@@ -83,32 +86,25 @@ public class Trailer extends AbstractJsonMapping {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
if (obj instanceof Trailer) {
|
||||
final Trailer other = (Trailer) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(name, other.name)
|
||||
.append(size, other.size)
|
||||
.append(source, other.source)
|
||||
.isEquals();
|
||||
} else {
|
||||
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;
|
||||
return new HashCodeBuilder()
|
||||
.append(name)
|
||||
.append(size)
|
||||
.append(source)
|
||||
.append(website)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
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;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
@@ -66,32 +68,25 @@ public class Translation extends AbstractJsonMapping {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
if (obj instanceof Translation) {
|
||||
final Translation other = (Translation) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(name, other.name)
|
||||
.append(englishName, other.englishName)
|
||||
.append(isoCode, other.isoCode)
|
||||
.isEquals();
|
||||
} else {
|
||||
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;
|
||||
return new HashCodeBuilder()
|
||||
.append(englishName)
|
||||
.append(isoCode)
|
||||
.append(name)
|
||||
.toHashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user