2 ms·
You don't need to have these issues. If you have a field that is optional, you can model that with the Optional type in Java 8. So I would model your dataList a
by noelwelsh 10y ago
You don't need to have these issues. If you have a field that is optional, you can model that with the Optional type in Java 8. So I would model your dataList as Option<List<Something>>. If I cared that a list is definitely not empty I would create a type called NonEmptyList to model that. This is very typical is Scala, which is the language I use most often.