Skip to content

Commit 8a10405

Browse files
author
Grzegorz Piwowarek
committed
Refactor Jackson examples
1 parent fa6f482 commit 8a10405

2 files changed

Lines changed: 18 additions & 22 deletions

File tree

‎jackson/src/main/java/org/baeldung/jackson/entities/ActorJackson.java‎

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,28 @@
33
import java.util.Date;
44
import java.util.List;
55

6-
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
7-
86
public class ActorJackson {
97

108
private String imdbId;
119
private Date dateOfBirth;
1210
private List<String> filmography;
1311

12+
public ActorJackson() {
13+
super();
14+
}
15+
16+
public ActorJackson(String imdbId, Date dateOfBirth, List<String> filmography) {
17+
super();
18+
this.imdbId = imdbId;
19+
this.dateOfBirth = dateOfBirth;
20+
this.filmography = filmography;
21+
}
22+
23+
@Override
24+
public String toString() {
25+
return "ActorJackson [imdbId=" + imdbId + ", dateOfBirth=" + dateOfBirth + ", filmography=" + filmography + "]";
26+
}
27+
1428
public String getImdbId() {
1529
return imdbId;
1630
}
@@ -35,21 +49,4 @@ public void setFilmography(List<String> filmography) {
3549
this.filmography = filmography;
3650
}
3751

38-
public ActorJackson(String imdbId, Date dateOfBirth, List<String> filmography) {
39-
super();
40-
this.imdbId = imdbId;
41-
this.dateOfBirth = dateOfBirth;
42-
this.filmography = filmography;
43-
}
44-
45-
public ActorJackson() {
46-
47-
super();
48-
}
49-
50-
@Override
51-
public String toString() {
52-
return "ActorJackson [imdbId=" + imdbId + ", dateOfBirth=" + dateOfBirth + ", filmography=" + filmography + "]";
53-
}
54-
5552
}

‎jackson/src/main/java/org/baeldung/jackson/entities/MovieWithNullValue.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package org.baeldung.jackson.entities;
22

3-
import java.util.List;
4-
53
import com.fasterxml.jackson.annotation.JsonIgnore;
6-
import com.google.gson.annotations.Expose;
4+
5+
import java.util.List;
76

87
public class MovieWithNullValue {
98

0 commit comments

Comments
 (0)