-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Labels
Description
Besides this stackoverflow question, I couldn't really find any information related to this topic but it would be nice to extend the support of default values in Jackson, particularly in the context of the MrBean module.
One option could be using annotations:
interface Person {
@DefaultValue("default first name")
String getFirstName();
@DefaultValue("default last name")
String getLastName();
}
Another option could be using Java 8 default methods:
interface Person {
default String getFirstName() { return "default first name"; }
default String getLastName() { return "default last name"; }
}
Currently, there are two main limitation I see for MrBean:
- No possibility to specify default values
- No possibility to use Java 8 Optional
remmeier, pthorson and Ghilteras