Assume that i have this code in my project:
public List<T> getAll(Integer parameter) {
if(parameter != null && parameter > -1) {
// do something here
}
}
my question is that how can i do the checking with Optional instead of using if, or if there is another thing that can i use it, please introduce it to me.
Aucun commentaire:
Enregistrer un commentaire