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
Post a Comment