List of utility methods to do Stream Operation
int | mapElementsSizes(IntStream intStream) map Elements Sizes OptionalInt n = intStream.reduce((a, b) -> (a == -1) ? -1 : (b == 1) ? a : (a == b) ? a : (a == 1) ? b : -1
);
return n.isPresent() ? n.getAsInt() : 1;
|
float | maximum(final Stream Get Maximum X position of TextPosition List . return stream.max(Float::compare).get().floatValue();
|
long | maxLong(Stream Returns the highest value on a stream of longs return stream.mapToLong(Long::valueOf).max().getAsLong();
|
int | maxStringLength(Stream max String Length return stringStream.mapToInt(String::length).max().getAsInt();
|
String | mkString(Stream mk String StringJoiner joiner = new StringJoiner(delimiter); items.forEach(joiner::add); return prefix + joiner.toString() + suffix; |
Stream | nullableStreamOf(Collection nullable Stream Of if (nullableCollection == null) { return Stream.empty(); return nullableCollection.stream(); |
Stream | ofType(Stream Keep only those elements in a stream that are of a given type. return stream.filter(type::isInstance).map(t -> (U) t);
|
Stream | opt2stream(Optional Turns an Optional return opt.map(Stream::of).orElseGet(Stream::empty);
|
Stream | optionalToStream(final Optional optional To Stream if (optional.isPresent()) return Stream.of(optional.get()); return Stream.of(); |
Stream | optionalToStream(Optional optional To Stream return optional.map(Stream::of).orElseGet(Stream::empty);
|