Skip to content

Commit a0b086c

Browse files
author
Grzegorz Piwowarek
committed
Refactor ActorGson
1 parent b2c2057 commit a0b086c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

gson/src/main/java/org/baeldung/gson/entities/ActorGson.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55

66
public class ActorGson {
77

8-
@Override
9-
public String toString() {
10-
return "ActorGson [imdbId=" + imdbId + ", dateOfBirth=" + dateOfBirth + ", filmography=" + filmography + "]";
11-
}
12-
138
private String imdbId;
149
private Date dateOfBirth;
1510
private List<String> filmography;
1611

12+
public ActorGson(String imdbId, Date dateOfBirth, List<String> filmography) {
13+
super();
14+
this.imdbId = imdbId;
15+
this.dateOfBirth = dateOfBirth;
16+
this.filmography = filmography;
17+
}
18+
19+
1720
public String getImdbId() {
1821
return imdbId;
1922
}
@@ -38,11 +41,8 @@ public void setFilmography(List<String> filmography) {
3841
this.filmography = filmography;
3942
}
4043

41-
public ActorGson(String imdbId, Date dateOfBirth, List<String> filmography) {
42-
super();
43-
this.imdbId = imdbId;
44-
this.dateOfBirth = dateOfBirth;
45-
this.filmography = filmography;
44+
@Override
45+
public String toString() {
46+
return "ActorGson [imdbId=" + imdbId + ", dateOfBirth=" + dateOfBirth + ", filmography=" + filmography + "]";
4647
}
47-
4848
}

0 commit comments

Comments
 (0)