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
{ | |
"id" : 1, | |
"title" : "title", | |
"description" : "description" | |
} |
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
String bookJson_normal = objectMapper.writerWithView(JsonView_Book_Type.Normal.class).writeValueAsString(jsonView_book); |
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
@NoArgsConstructor | |
@AllArgsConstructor | |
@Getter | |
@Setter | |
public class JsonView_Book { | |
private Long id; | |
@JsonView(JsonView_Book_Type.Normal.class) | |
private String title; |
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
{ | |
"id" : 1 | |
} |
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
public class JsonIgnore_Book { | |
private Long id; | |
@JsonIgnore | |
private String isbn; | |
public JsonIgnore_Book() { | |
} |
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
@JsonAutoDetect( | |
fieldVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY, | |
getterVisibility = JsonAutoDetect.Visibility.NONE | |
) | |
public class JsonAutoDetect_Book { | |
public Long id; | |
private String isbn; |
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
{ | |
"id" : 1 | |
} |
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
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY) | |
public class JsonAutoDetect_Book { | |
public Long id; | |
private String isbn; | |
public JsonAutoDetect_Book() { | |
} |
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
{ | |
"BOOK-ID" : 1, | |
"BOOK-ISBN" : "123-456-78" | |
} |
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
package annotations.naming; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
public class JsonProperty_Book { | |
@JsonProperty("BOOK-ID") | |
private Long id; | |
@JsonProperty("BOOK-ISBN") |