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

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -