Refactor Jackson examples

This commit is contained in:
Grzegorz Piwowarek 2016-08-10 19:06:35 +02:00
parent fa6f482f2a
commit 8a104053d6
2 changed files with 18 additions and 22 deletions

View File

@ -3,14 +3,28 @@ package org.baeldung.jackson.entities;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
public class ActorJackson {
private String imdbId;
private Date dateOfBirth;
private List<String> filmography;
public ActorJackson() {
super();
}
public ActorJackson(String imdbId, Date dateOfBirth, List<String> filmography) {
super();
this.imdbId = imdbId;
this.dateOfBirth = dateOfBirth;
this.filmography = filmography;
}
@Override
public String toString() {
return "ActorJackson [imdbId=" + imdbId + ", dateOfBirth=" + dateOfBirth + ", filmography=" + filmography + "]";
}
public String getImdbId() {
return imdbId;
}
@ -35,21 +49,4 @@ public class ActorJackson {
this.filmography = filmography;
}
public ActorJackson(String imdbId, Date dateOfBirth, List<String> filmography) {
super();
this.imdbId = imdbId;
this.dateOfBirth = dateOfBirth;
this.filmography = filmography;
}
public ActorJackson() {
super();
}
@Override
public String toString() {
return "ActorJackson [imdbId=" + imdbId + ", dateOfBirth=" + dateOfBirth + ", filmography=" + filmography + "]";
}
}

View File

@ -1,9 +1,8 @@
package org.baeldung.jackson.entities;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.gson.annotations.Expose;
import java.util.List;
public class MovieWithNullValue {