diff --git a/themoviedbapi/src/com/moviejukebox/themoviedb/model/Category.java b/themoviedbapi/src/com/moviejukebox/themoviedb/model/Category.java index 7e3dba6be..a32615fc1 100644 --- a/themoviedbapi/src/com/moviejukebox/themoviedb/model/Category.java +++ b/themoviedbapi/src/com/moviejukebox/themoviedb/model/Category.java @@ -23,27 +23,36 @@ public class Category { public String type; public String name; public String url; + public String id; - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; + public String getId() { + return id; } public String getName() { return name; } - public void setName(String name) { - this.name = name; + public String getType() { + return type; } public String getUrl() { return url; } + public void setId(String id) { + this.id = id; + } + + public void setName(String name) { + this.name = name; + } + + public void setType(String type) { + this.type = type; + } + public void setUrl(String url) { this.url = url; } diff --git a/themoviedbapi/src/com/moviejukebox/themoviedb/model/MovieDB.java b/themoviedbapi/src/com/moviejukebox/themoviedb/model/MovieDB.java index d6ccb816b..18efa4e5c 100644 --- a/themoviedbapi/src/com/moviejukebox/themoviedb/model/MovieDB.java +++ b/themoviedbapi/src/com/moviejukebox/themoviedb/model/MovieDB.java @@ -271,7 +271,13 @@ public class MovieDB extends ModelTools { public void setStudios(List studios) { this.studios = studios; } - + + public void addStudio(Studio studio) { + if (studio != null) { + this.studios.add(studio); + } + } + public void setCountries(List countries) { this.countries = countries; } diff --git a/themoviedbapi/src/com/moviejukebox/themoviedb/model/Person.java b/themoviedbapi/src/com/moviejukebox/themoviedb/model/Person.java index 4adb0a2ed..757a17045 100644 --- a/themoviedbapi/src/com/moviejukebox/themoviedb/model/Person.java +++ b/themoviedbapi/src/com/moviejukebox/themoviedb/model/Person.java @@ -28,109 +28,171 @@ import com.moviejukebox.themoviedb.tools.ModelTools; * */ public class Person extends ModelTools { - private String biography; - private String character; - private String id; - private String job; - private String name; - private String url; - private int version; + private static String UNKNOWN = MovieDB.UNKNOWN; + + private String name = UNKNOWN; + private String character = UNKNOWN; + private String job = UNKNOWN; + private String id = UNKNOWN; + private String department = UNKNOWN; + private String biography = UNKNOWN; + private String url = UNKNOWN; + private int order = -1; + private int castId = -1; + private int version = -1; private Date lastModifiedAt; + private int knownMovies = -1; + private Date birthday; + private String birthPlace = UNKNOWN; private List filmography = new ArrayList(); private List aka = new ArrayList(); - private int knownMovies; - private Date birthday; - private String birthPlace; - + private List images = new ArrayList(); + + public void addAka(String alsoKnownAs) { + this.aka.add(alsoKnownAs); + } + + public void addFilm(Filmography film) { + this.filmography.add(film); + } + + public void addImage(Artwork image) { + if (image != null) { + this.images.add(image); + } + } + + public List getAka() { + return aka; + } public String getBiography() { return biography; } - public void setBiography(String biography) { - this.biography = biography; + public Date getBirthday() { + return birthday; + } + + public String getBirthPlace() { + return birthPlace; + } + + public int getCastId() { + return castId; } public String getCharacter() { return character; } - public void setCharacter(String character) { - this.character = character; + public String getDepartment() { + return department; + } + + public List getFilmography() { + return filmography; } public String getId() { return id; } - public void setId(String id) { - this.id = id; + public List getImages() { + return images; } public String getJob() { return job; } - - public void setJob(String job) { - this.job = job; + + public int getKnownMovies() { + return knownMovies; + } + + public Date getLastModifiedAt() { + return lastModifiedAt; } public String getName() { return name; } - - public void setName(String name) { - this.name = name; + + public int getOrder() { + return order; } - + public String getUrl() { return url; } - public void setUrl(String url) { - this.url = url; - } - public int getVersion() { return version; } + + public void setAka(List aka) { + this.aka = aka; + } + + public void setBiography(String biography) { + this.biography = biography; + } - public void setVersion(int version) { - this.version = version; + public void setBirthday(Date birthday) { + this.birthday = birthday; } - public List getFilmography() { - return filmography; + public void setBirthday(String sBirthday) { + DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); + + try { + Date birthday = df.parse(sBirthday); + setBirthday(birthday); + } catch (Exception ignore) { + return; + } } - public void setFilmography(List filmography) { - this.filmography = filmography; + public void setBirthPlace(String birthPlace) { + this.birthPlace = birthPlace; + } + + public void setCastId(int castId) { + this.castId = castId; + } + + public void setCharacter(String character) { + this.character = character; } - public void addFilm(Filmography film) { - this.filmography.add(film); + public void setDepartment(String department) { + this.department = department; } - public List getAka() { - return aka; + public void setFilmography(List filmography) { + this.filmography = filmography; } - public void setAka(List aka) { - this.aka = aka; + public void setId(String id) { + this.id = id; } - - public void addAka(String alsoKnownAs) { - this.aka.add(alsoKnownAs); + + public void setImages(List images) { + this.images = images; } - public Date getLastModifiedAt() { - return lastModifiedAt; + public void setJob(String job) { + this.job = job; + } + + public void setKnownMovies(int knownMovies) { + this.knownMovies = knownMovies; } public void setLastModifiedAt(Date lastModifiedAt) { this.lastModifiedAt = lastModifiedAt; } - + public void setLastModifiedAt(String lastModifiedAt) { DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -142,38 +204,19 @@ public class Person extends ModelTools { } } - public int getKnownMovies() { - return knownMovies; - } - - public void setKnownMovies(int knownMovies) { - this.knownMovies = knownMovies; + public void setName(String name) { + this.name = name; } - public Date getBirthday() { - return birthday; + public void setOrder(int order) { + this.order = order; } - public void setBirthday(Date birthday) { - this.birthday = birthday; + public void setUrl(String url) { + this.url = url; } - public void setBirthday(String sBirthday) { - DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); - - try { - Date birthday = df.parse(sBirthday); - setBirthday(birthday); - } catch (Exception ignore) { - return; - } - } - - public String getBirthPlace() { - return birthPlace; - } - - public void setBirthPlace(String birthPlace) { - this.birthPlace = birthPlace; + public void setVersion(int version) { + this.version = version; } }