-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
231 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...src/main/java/com/example/demo/application/dto/jsoninclude/JsonIncludeAlwaysResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.example.demo.application.dto.jsoninclude; | ||
|
||
import com.example.demo.application.MemberRole; | ||
import com.example.demo.domain.Team; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@JsonInclude(Include.ALWAYS) | ||
public class JsonIncludeAlwaysResponse { | ||
private int defaultInt; | ||
private int normalInt; | ||
|
||
private Integer defaultWrapper; | ||
private Integer normalWrapper; | ||
|
||
private String nullString; | ||
private String emptyString; | ||
private String normalString; | ||
|
||
private Team nullReference; | ||
private Team normalReference; | ||
|
||
private List<String> emptyList; | ||
private List<String> normalList; | ||
|
||
public static JsonIncludeAlwaysResponse create() { | ||
return new JsonIncludeAlwaysResponse(0, 10, | ||
0, 10, | ||
null, "", "string", | ||
null, new Team("teamA"), | ||
new ArrayList<>(), List.of("str1") | ||
); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
.../main/java/com/example/demo/application/dto/jsoninclude/JsonIncludeNonAbsentResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.example.demo.application.dto.jsoninclude; | ||
|
||
import com.example.demo.application.MemberRole; | ||
import com.example.demo.domain.Team; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@JsonInclude(Include.NON_ABSENT) | ||
public class JsonIncludeNonAbsentResponse { | ||
private int defaultInt; | ||
private int normalInt; | ||
|
||
private Integer defaultWrapper; | ||
private Integer normalWrapper; | ||
|
||
private String nullString; | ||
private String emptyString; | ||
private String normalString; | ||
|
||
private Team nullReference; | ||
private Team normalReference; | ||
|
||
private List<String> emptyList; | ||
private List<String> normalList; | ||
|
||
public static JsonIncludeNonAbsentResponse create() { | ||
return new JsonIncludeNonAbsentResponse(0, 10, | ||
0, 10, | ||
null, "", "string", | ||
null, new Team("teamA"), | ||
new ArrayList<>(), List.of("str1") | ||
); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...main/java/com/example/demo/application/dto/jsoninclude/JsonIncludeNonDefaultResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.example.demo.application.dto.jsoninclude; | ||
|
||
import com.example.demo.application.MemberRole; | ||
import com.example.demo.domain.Team; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@JsonInclude(Include.NON_DEFAULT) | ||
public class JsonIncludeNonDefaultResponse { | ||
private int defaultInt; | ||
private int normalInt; | ||
|
||
private Integer defaultWrapper; | ||
private Integer normalWrapper; | ||
|
||
private String nullString; | ||
private String emptyString; | ||
private String normalString; | ||
|
||
private Team nullReference; | ||
private Team normalReference; | ||
|
||
private List<String> emptyList; | ||
private List<String> normalList; | ||
|
||
public static JsonIncludeNonDefaultResponse create() { | ||
return new JsonIncludeNonDefaultResponse(0, 10, | ||
0, 10, | ||
null, "", "string", | ||
null, new Team("teamA"), | ||
new ArrayList<>(), List.of("str1") | ||
); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...c/main/java/com/example/demo/application/dto/jsoninclude/JsonIncludeNonEmptyResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.example.demo.application.dto.jsoninclude; | ||
|
||
import com.example.demo.application.MemberRole; | ||
import com.example.demo.domain.Team; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@JsonInclude(Include.NON_EMPTY) | ||
public class JsonIncludeNonEmptyResponse { | ||
private int defaultInt; | ||
private int normalInt; | ||
|
||
private Integer defaultWrapper; | ||
private Integer normalWrapper; | ||
|
||
private String nullString; | ||
private String emptyString; | ||
private String normalString; | ||
|
||
private Team nullReference; | ||
private Team normalReference; | ||
|
||
private List<String> emptyList; | ||
private List<String> normalList; | ||
|
||
public static JsonIncludeNonEmptyResponse create() { | ||
return new JsonIncludeNonEmptyResponse(0, 10, | ||
0, 10, | ||
null, "", "string", | ||
null, new Team("teamA"), | ||
new ArrayList<>(), List.of("str1") | ||
); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...rc/main/java/com/example/demo/application/dto/jsoninclude/JsonIncludeNonNullResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.example.demo.application.dto.jsoninclude; | ||
|
||
import com.example.demo.application.MemberRole; | ||
import com.example.demo.domain.Team; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@JsonInclude(Include.NON_NULL) | ||
public class JsonIncludeNonNullResponse { | ||
private int defaultInt; | ||
private int normalInt; | ||
|
||
private Integer defaultWrapper; | ||
private Integer normalWrapper; | ||
|
||
private String nullString; | ||
private String emptyString; | ||
private String normalString; | ||
|
||
private Team nullReference; | ||
private Team normalReference; | ||
|
||
private List<String> emptyList; | ||
private List<String> normalList; | ||
|
||
public static JsonIncludeNonNullResponse create() { | ||
return new JsonIncludeNonNullResponse(0, 10, | ||
0, 10, | ||
null, "", "string", | ||
null, new Team("teamA"), | ||
new ArrayList<>(), List.of("str1") | ||
); | ||
} | ||
} |