Java - blocking empty/null values from scanner for the future stream().map() use

I have a following problem: I need to read input from user to create an object and add it to the collection. I use a builder pattern for that. Normally, it was working with an old method, declaring an Optional and then mapping the returned Optional with scanner (highest and lowest method in the code).

Unfortunatelly, I need to change that so that all the fields for the object were mandatory from now on. Replacing the Optional in the current attempt(the one in the middle) resulted in the .map not...

Read More »

By: StackOverFlow - 5 days ago

Related Posts