Skip to content

Instantly share code, notes, and snippets.

@relax-more
Last active January 12, 2016 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save relax-more/4ae24dda9702de3fca02 to your computer and use it in GitHub Desktop.
Save relax-more/4ae24dda9702de3fca02 to your computer and use it in GitHub Desktop.
// detail
// http://fasterxml.github.io/jackson-annotations/javadoc/2.0.5/com/fasterxml/jackson/annotation/JsonInclude.Include.html
public class JacksonTest {
String test;
// use "nonDefault" if null
@JsonInclude(Include.NON_DEFAULT)
String nonDefault = "nonDefault";
// ignore if null
@JsonInclude(Include.NON_NULL)
// ignore if empty
@JsonInclude(Include.NON_EMPTY)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment