Trim the string values for person to remove extra spaces

master
Stuart Boston 13 years ago
parent 72186feaf9
commit bb57c16fe8

@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
@ -91,14 +92,14 @@ public class Person implements Serializable {
* @param job
*/
public void addCrew(int id, String name, String profilePath, String department, String job) {
this.personType = PersonType.CREW;
this.id = id;
this.name = name;
this.profilePath = profilePath;
this.department = department;
this.job = job;
this.character = "";
this.order = -1;
setPersonType(PersonType.CREW);
setId(id);
setName(name);
setProfilePath(profilePath);
setDepartment(department);
setJob(job);
setCharacter("");
setOrder(-1);
}
/**
@ -111,14 +112,14 @@ public class Person implements Serializable {
* @param order
*/
public void addCast(int id, String name, String profilePath, String character, int order) {
this.personType = PersonType.CAST;
this.id = id;
this.name = name;
this.profilePath = profilePath;
this.character = character;
this.order = order;
this.department = CAST_DEPARTMENT;
this.job = CAST_JOB;
setPersonType(PersonType.CAST);
setId(id);
setName(name);
setProfilePath(profilePath);
setCharacter(character);
setOrder(order);
setDepartment(CAST_DEPARTMENT);
setJob(CAST_JOB);
}
// <editor-fold defaultstate="collapsed" desc="Getter methods">
@ -205,11 +206,11 @@ public class Person implements Serializable {
}
public void setJob(String job) {
this.job = job;
this.job = StringUtils.trimToEmpty(job);
}
public void setName(String name) {
this.name = name;
this.name = StringUtils.trimToEmpty(name);
}
public void setOrder(int order) {
@ -221,7 +222,7 @@ public class Person implements Serializable {
}
public void setProfilePath(String profilePath) {
this.profilePath = profilePath;
this.profilePath = StringUtils.trimToEmpty(profilePath);
}
public void setAdult(boolean adult) {
@ -233,27 +234,27 @@ public class Person implements Serializable {
}
public void setBiography(String biography) {
this.biography = biography;
this.biography = StringUtils.trimToEmpty(biography);
}
public void setBirthday(String birthday) {
this.birthday = birthday;
this.birthday = StringUtils.trimToEmpty(birthday);
}
public void setBirthplace(String birthplace) {
this.birthplace = birthplace;
this.birthplace = StringUtils.trimToEmpty(birthplace);
}
public void setDeathday(String deathday) {
this.deathday = deathday;
this.deathday = StringUtils.trimToEmpty(deathday);
}
public void setHomepage(String homepage) {
this.homepage = homepage;
this.homepage = StringUtils.trimToEmpty(homepage);
}
public void setImdbId(String imdbId) {
this.imdbId = imdbId;
this.imdbId = StringUtils.trimToEmpty(imdbId);
}
public void setPopularity(float popularity) {

@ -22,6 +22,7 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
@ -84,7 +85,7 @@ public class PersonCast implements Serializable {
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setCharacter(String character) {
this.character = character;
this.character = StringUtils.trimToEmpty(character);
}
public void setId(int id) {
@ -92,7 +93,7 @@ public class PersonCast implements Serializable {
}
public void setName(String name) {
this.name = name;
this.name = StringUtils.trimToEmpty(name);
}
public void setOrder(int order) {
@ -100,7 +101,7 @@ public class PersonCast implements Serializable {
}
public void setProfilePath(String profilePath) {
this.profilePath = profilePath;
this.profilePath = StringUtils.trimToEmpty(profilePath);
}
public void setCastId(int castId) {

@ -22,6 +22,7 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
@ -107,15 +108,15 @@ public class PersonCredit implements Serializable {
//<editor-fold defaultstate="collapsed" desc="Setter Methods">
public void setCharacter(String character) {
this.character = character;
this.character = StringUtils.trimToEmpty(character);
}
public void setDepartment(String department) {
this.department = department;
this.department = StringUtils.trimToEmpty(department);
}
public void setJob(String job) {
this.job = job;
this.job = StringUtils.trimToEmpty(job);
}
public void setMovieId(int movieId) {
@ -123,11 +124,11 @@ public class PersonCredit implements Serializable {
}
public void setMovieOriginalTitle(String movieOriginalTitle) {
this.movieOriginalTitle = movieOriginalTitle;
this.movieOriginalTitle = StringUtils.trimToEmpty(movieOriginalTitle);
}
public void setMovieTitle(String movieTitle) {
this.movieTitle = movieTitle;
this.movieTitle = StringUtils.trimToEmpty(movieTitle);
}
public void setPersonType(PersonType personType) {
@ -135,15 +136,15 @@ public class PersonCredit implements Serializable {
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
this.posterPath = StringUtils.trimToEmpty(posterPath);
}
public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
this.releaseDate = StringUtils.trimToEmpty(releaseDate);
}
public void setAdult(String adult) {
this.adult = adult;
this.adult = StringUtils.trimToEmpty(adult);
}
//</editor-fold>

@ -22,6 +22,7 @@ package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
@ -77,7 +78,7 @@ public class PersonCrew implements Serializable {
//<editor-fold defaultstate="collapsed" desc="Setter methods">
public void setDepartment(String department) {
this.department = department;
this.department = StringUtils.trimToEmpty(department);
}
public void setId(int id) {
@ -85,15 +86,15 @@ public class PersonCrew implements Serializable {
}
public void setJob(String job) {
this.job = job;
this.job = StringUtils.trimToEmpty(job);
}
public void setName(String name) {
this.name = name;
this.name = StringUtils.trimToEmpty(name);
}
public void setProfilePath(String profilePath) {
this.profilePath = profilePath;
this.profilePath = StringUtils.trimToEmpty(profilePath);
}
//</editor-fold>

Loading…
Cancel
Save