Tracking issue for StatusOr Experimental API
Offen
#11,563
1 Kommentar
0 Reaktionen
1 zugewiesene Person
Beansprucht von @kannanjgithub
Auf GitHub ansehen
experimental API
- Vorherrschende Sprache
- Java
- Sterne
- 12.1k
- Forks
- 4k
- Ø Merge
- 2 T. 17 Std.
- Gemergte PRs (30 T.)
- 37
Beschreibung
**Allow null?**
StatusOr needs to be as expressive as a method return value, although it will generally not be null. Can potentially use StatusOr<@NonNull> in cases it should be disallowed.
**Should getValue() throw if there is no value?**
Go with just getValue() throwing IllegalStateException for now. Can add getValueOrNull, getValueOrDefault, getValueOrThrow as we find usecases. Seems the majority case should check getStatus() first.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.