Refactor Jackson examples
This commit is contained in:
parent
fa6f482f2a
commit
8a104053d6
|
@ -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 + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Reference in New Issue