FasterXML / FasterXML/jackson-modules-base

Support for default values

オープン
#23 コメント 11 件 リアクション 3 件 担当者 0 名 GitHub で見る
mrbean
主要言語
Java
スター
180
フォーク
80
平均マージ
3時間 26分
マージ済み PR(30日)
1

説明

Besides [this](http://stackoverflow.com/questions/37197174/how-to-specify-default-values-when-using-jackson-with-mr-bean) 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:

```java
interface Person {
@DefaultValue("default first name")
String getFirstName();
@DefaultValue("default last name")
String getLastName();
}
```

Another option could be using Java 8 default methods:

```java
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:

1. No possibility to specify default values
2. No possibility to use Java 8 Optional

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。