From 8a104053d6ed9845857ed365bb3e59d694512fcc Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Wed, 10 Aug 2016 19:06:35 +0200 Subject: [PATCH] Refactor Jackson examples --- .../jackson/entities/ActorJackson.java | 35 +++++++++---------- .../jackson/entities/MovieWithNullValue.java | 5 ++- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/jackson/src/main/java/org/baeldung/jackson/entities/ActorJackson.java b/jackson/src/main/java/org/baeldung/jackson/entities/ActorJackson.java index 7d9d6549c0..68cd6117d6 100644 --- a/jackson/src/main/java/org/baeldung/jackson/entities/ActorJackson.java +++ b/jackson/src/main/java/org/baeldung/jackson/entities/ActorJackson.java @@ -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 filmography; + public ActorJackson() { + super(); + } + + public ActorJackson(String imdbId, Date dateOfBirth, List 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 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 + "]"; - } - } diff --git a/jackson/src/main/java/org/baeldung/jackson/entities/MovieWithNullValue.java b/jackson/src/main/java/org/baeldung/jackson/entities/MovieWithNullValue.java index d04d37c947..23f5de2858 100644 --- a/jackson/src/main/java/org/baeldung/jackson/entities/MovieWithNullValue.java +++ b/jackson/src/main/java/org/baeldung/jackson/entities/MovieWithNullValue.java @@ -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 {