| Modifier and Type | Method and Description |
|---|---|
static <T> Iterable<T> |
asIterable(Stream<T> stream)
|
static <T> Stream<T> |
streamEnumeration(Enumeration<T> enumeration)
Converts an
Enumeration to a Stream. |
static <T> Stream<T> |
streamIterable(Iterable<T> iterable)
Converts an
Iterable to a Stream. |
static <T> Stream<T> |
streamOptional(Optional<T> optional)
Converts an
Optional to a single-element or empty Stream. |
@Nonnull public static <T> Stream<T> streamEnumeration(@Nonnull Enumeration<T> enumeration)
Enumeration to a Stream.T - the type of element in the Enumerationenumeration - the Enumeration to streamStream over the provided enumerationNullPointerException - if the provided enumeration is null@Nonnull public static <T> Stream<T> streamIterable(@Nonnull Iterable<T> iterable)
Iterable to a Stream.T - the type of element in the Iterableiterable - the Iterable to streamStream over the provided iterableNullPointerException - if the provided iterable is null@Nonnull public static <T> Stream<T> streamOptional(@Nonnull Optional<T> optional)
Optional to a single-element or empty Stream.T - the type of element in the Optionaloptional - the Optional to streamStream if the Optional is present; otherwise an empty StreamNullPointerException - if the provided optional is nullCopyright © 2020 Atlassian. All rights reserved.