diff --git a/src/main/java/com/omertron/themoviedbapi/model/person/PersonBasic.java b/src/main/java/com/omertron/themoviedbapi/model/person/PersonBasic.java index 50af11486..9f47f5a9a 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/person/PersonBasic.java +++ b/src/main/java/com/omertron/themoviedbapi/model/person/PersonBasic.java @@ -20,6 +20,8 @@ package com.omertron.themoviedbapi.model.person; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.omertron.themoviedbapi.enumeration.Gender; import com.omertron.themoviedbapi.model.AbstractIdName; import java.io.Serializable; @@ -32,6 +34,8 @@ public class PersonBasic extends AbstractIdName implements Serializable { @JsonProperty("profile_path") private String profilePath; + @JsonProperty("gender") + private Gender gender; public String getProfilePath() { return profilePath; @@ -40,4 +44,18 @@ public class PersonBasic extends AbstractIdName implements Serializable { public void setProfilePath(String profilePath) { this.profilePath = profilePath; } + + public Gender getGender() { + return gender; + } + + @JsonSetter("gender") + public void setGender(int gender) { + this.gender = Gender.fromInteger(gender); + } + + public void setGender(Gender gender) { + this.gender = gender; + } + } diff --git a/src/main/java/com/omertron/themoviedbapi/model/person/PersonInfo.java b/src/main/java/com/omertron/themoviedbapi/model/person/PersonInfo.java index 90a1f0349..8d3335c83 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/person/PersonInfo.java +++ b/src/main/java/com/omertron/themoviedbapi/model/person/PersonInfo.java @@ -21,7 +21,6 @@ package com.omertron.themoviedbapi.model.person; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; -import com.omertron.themoviedbapi.enumeration.Gender; import com.omertron.themoviedbapi.enumeration.PeopleMethod; import com.omertron.themoviedbapi.interfaces.AppendToResponse; import com.omertron.themoviedbapi.model.artwork.Artwork; @@ -63,7 +62,6 @@ public class PersonInfo extends PersonBasic implements Serializable, AppendToRes private String placeOfBirth; @JsonProperty("popularity") private float popularity; - private Gender gender; // AppendToResponse private final Set methods = EnumSet.noneOf(PeopleMethod.class); // AppendToResponse Properties @@ -152,15 +150,6 @@ public class PersonInfo extends PersonBasic implements Serializable, AppendToRes methods.add(method); } - public Gender getGender() { - return gender; - } - - @JsonSetter("gender") - public void setGender(int gender) { - this.gender = Gender.fromInteger(gender); - } - @Override public boolean hasMethod(PeopleMethod method) { return methods.contains(method);