java - Why is there no mapToInt() in the OptionalInt class? -


the intstream class has map(), maptoobj(), maptolong() , maptodouble() methods, methods seem missing optionalint class.

is there reason methods missing?

rather obtusely can do

optionalint oi = optionalint.of(1); oi.ifpresent(i -> intstream.of(i).map(j -> j + 1).foreach(system.out::println)); 

however not clear why optionalint doesn't have same methods intstream although note optional has subset of stream


Comments

Popular posts from this blog

c - Calling a function within a loop -

vb.net - Unbound DataGridView add row with checkbox error -

How i fill combobox items in Radgridview manually using in vb.net -