Add Interfaces where appropriate
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
*/
|
||||
package com.omertron.themoviedbapi.model;
|
||||
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
|
||||
@@ -21,6 +21,7 @@ package com.omertron.themoviedbapi.model.collection;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
@@ -30,7 +31,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
* @author stuart.boston
|
||||
*/
|
||||
@JsonRootName("collection")
|
||||
public class Collection extends AbstractJsonMapping {
|
||||
public class Collection extends AbstractJsonMapping implements IIdentification{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -51,6 +52,7 @@ public class Collection extends AbstractJsonMapping {
|
||||
return backdropPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -81,6 +83,7 @@ public class Collection extends AbstractJsonMapping {
|
||||
this.backdropPath = backdropPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
package com.omertron.themoviedbapi.model.collection;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -28,7 +29,7 @@ import java.util.List;
|
||||
/**
|
||||
* @author Stuart
|
||||
*/
|
||||
public class CollectionInfo extends AbstractJsonMapping {
|
||||
public class CollectionInfo extends AbstractJsonMapping implements IIdentification {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -49,6 +50,7 @@ public class CollectionInfo extends AbstractJsonMapping {
|
||||
return backdropPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -73,6 +75,7 @@ public class CollectionInfo extends AbstractJsonMapping {
|
||||
this.backdropPath = backdropPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -31,15 +31,11 @@ public class AlternativeTitle implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/*
|
||||
* Properties
|
||||
*/
|
||||
@JsonProperty("iso_3166_1")
|
||||
private String country;
|
||||
@JsonProperty("title")
|
||||
private String title;
|
||||
|
||||
// <editor-fold defaultstate="collapsed" desc="Getter methods">
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
@@ -47,9 +43,7 @@ public class AlternativeTitle implements Serializable {
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
// <editor-fold defaultstate="collapsed" desc="Setter methods">
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
@@ -57,7 +51,6 @@ public class AlternativeTitle implements Serializable {
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
@@ -20,13 +20,14 @@
|
||||
package com.omertron.themoviedbapi.model.media;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Stuart.Boston
|
||||
*/
|
||||
public class MediaCredit extends AbstractJsonMapping {
|
||||
public class MediaCredit extends AbstractJsonMapping implements IIdentification {
|
||||
|
||||
@JsonProperty("credit_id")
|
||||
private String creditId;
|
||||
@@ -45,10 +46,12 @@ public class MediaCredit extends AbstractJsonMapping {
|
||||
this.creditId = creditId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -20,13 +20,14 @@
|
||||
package com.omertron.themoviedbapi.model.media;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author stuart.boston
|
||||
*/
|
||||
public class MediaCreditList extends AbstractJsonMapping {
|
||||
public class MediaCreditList extends AbstractJsonMapping implements IIdentification{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -39,10 +40,12 @@ public class MediaCreditList extends AbstractJsonMapping {
|
||||
@JsonProperty("crew")
|
||||
private List<MediaCreditCrew> crew;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -21,13 +21,14 @@ package com.omertron.themoviedbapi.model.media;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Stuart.Boston
|
||||
*/
|
||||
public class MediaState extends AbstractJsonMapping {
|
||||
public class MediaState extends AbstractJsonMapping implements IIdentification {
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
@@ -37,10 +38,12 @@ public class MediaState extends AbstractJsonMapping {
|
||||
private boolean watchlist;
|
||||
private float rated;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.omertron.themoviedbapi.model.media.Translation;
|
||||
import com.omertron.themoviedbapi.model.media.AlternativeTitle;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import com.omertron.themoviedbapi.model.Genre;
|
||||
import com.omertron.themoviedbapi.model.Language;
|
||||
@@ -51,7 +52,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
*
|
||||
* @author stuart.boston
|
||||
*/
|
||||
public class MovieInfo extends AbstractJsonMapping {
|
||||
public class MovieInfo extends AbstractJsonMapping implements IIdentification {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@JsonProperty("backdrop_path")
|
||||
@@ -130,6 +131,7 @@ public class MovieInfo extends AbstractJsonMapping {
|
||||
return backdropPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -236,6 +238,7 @@ public class MovieInfo extends AbstractJsonMapping {
|
||||
this.backdropPath = backdropPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -33,9 +33,6 @@ public class ProductionCountry extends AbstractJsonMapping {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/*
|
||||
* Properties
|
||||
*/
|
||||
@JsonProperty("iso_3166_1")
|
||||
private String isoCode;
|
||||
@JsonProperty("name")
|
||||
|
||||
@@ -31,9 +31,6 @@ public class ReleaseInfo extends AbstractJsonMapping {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/*
|
||||
* Properties
|
||||
*/
|
||||
@JsonProperty("iso_3166_1")
|
||||
private String country;
|
||||
@JsonProperty("certification")
|
||||
|
||||
@@ -21,11 +21,12 @@ package com.omertron.themoviedbapi.model.network;
|
||||
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
|
||||
/**
|
||||
* @author stuart.boston
|
||||
*/
|
||||
public class Network extends AbstractJsonMapping {
|
||||
public class Network extends AbstractJsonMapping implements IIdentification {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -34,10 +35,12 @@ public class Network extends AbstractJsonMapping {
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -23,12 +23,13 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||
import com.omertron.themoviedbapi.enumeration.CreditType;
|
||||
import com.omertron.themoviedbapi.enumeration.MediaType;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
|
||||
/**
|
||||
* @author stuart.boston
|
||||
*/
|
||||
public class CreditBasic extends AbstractJsonMapping {
|
||||
public class CreditBasic extends AbstractJsonMapping implements IIdentification {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -80,10 +81,12 @@ public class CreditBasic extends AbstractJsonMapping {
|
||||
this.creditId = creditId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -21,17 +21,18 @@ package com.omertron.themoviedbapi.model.person;
|
||||
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
import com.omertron.themoviedbapi.model.tv.TVCredit;
|
||||
|
||||
/**
|
||||
* @author stuart.boston
|
||||
*/
|
||||
public class CreditInfo extends AbstractJsonMapping {
|
||||
public class CreditInfo extends AbstractJsonMapping implements IIdentification {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
private int id;
|
||||
@JsonProperty("credit_type")
|
||||
private String creditType;
|
||||
@JsonProperty("department")
|
||||
@@ -45,11 +46,13 @@ public class CreditInfo extends AbstractJsonMapping {
|
||||
@JsonProperty("media")
|
||||
private TVCredit media;
|
||||
|
||||
public String getId() {
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,16 +20,17 @@
|
||||
package com.omertron.themoviedbapi.model.person;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Stuart
|
||||
*/
|
||||
public class ExternalID extends AbstractJsonMapping {
|
||||
public class ExternalID extends AbstractJsonMapping implements IIdentification {
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
private int id;
|
||||
@JsonProperty("imdb_id")
|
||||
private String imdbId;
|
||||
@JsonProperty("freebase_mid")
|
||||
@@ -41,11 +42,13 @@ public class ExternalID extends AbstractJsonMapping {
|
||||
@JsonProperty("tvrage_id")
|
||||
private String tvrageId;
|
||||
|
||||
public String getId() {
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ package com.omertron.themoviedbapi.model.person;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import java.util.List;
|
||||
|
||||
@@ -28,7 +29,7 @@ import java.util.List;
|
||||
* @author stuart.boston
|
||||
* @param <T>
|
||||
*/
|
||||
public class PersonCredits<T extends CreditBasic> extends AbstractJsonMapping {
|
||||
public class PersonCredits<T extends CreditBasic> extends AbstractJsonMapping implements IIdentification {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -37,10 +38,12 @@ public class PersonCredits<T extends CreditBasic> extends AbstractJsonMapping {
|
||||
private List<T> cast;
|
||||
private List<T> crew;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -27,13 +27,12 @@ import com.omertron.themoviedbapi.model.media.MediaBasic;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieBasic;
|
||||
import com.omertron.themoviedbapi.model.tv.TVBasic;
|
||||
import com.omertron.themoviedbapi.model.tv.TVEpisodeBasic;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author stuart.boston
|
||||
*/
|
||||
public class PersonFind extends PersonBasic implements IIdentification {
|
||||
public class PersonFind extends PersonBasic {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@JsonProperty("adult")
|
||||
|
||||
@@ -21,13 +21,14 @@ package com.omertron.themoviedbapi.model.tv;
|
||||
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.interfaces.IIdentification;
|
||||
|
||||
/**
|
||||
* TV Favorite information
|
||||
*
|
||||
* @author stuart.boston
|
||||
*/
|
||||
public class TVSeasonBasic extends AbstractJsonMapping {
|
||||
public class TVSeasonBasic extends AbstractJsonMapping implements IIdentification {
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id = -1;
|
||||
@@ -40,10 +41,12 @@ public class TVSeasonBasic extends AbstractJsonMapping {
|
||||
@JsonProperty("episode_count")
|
||||
private int episodeCount = -1;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
//@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class TmdbListsTest extends AbstractTests {
|
||||
|
||||
private static TmdbLists instance;
|
||||
|
||||
Reference in New Issue
Block a user