public class StreamsUtil extends Object
Constructor and Description |
---|
StreamsUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> Stream<T> |
closing(Stream<T> stream) |
static <T> Stream<T> |
throwIfEmpty(Stream<T> stream,
RuntimeException ex)
Returns the original stream if the stream is not empty.
|
public static <T> Stream<T> throwIfEmpty(Stream<T> stream, RuntimeException ex)
stream
- Stream to be examined.ex
- Exception to be thrown if the stream is empty.Copyright © 2020 JBoss by Red Hat. All rights reserved.