public interface NodeStreamElement<T>
| Modifier and Type | Field and Description |
|---|---|
static NodeStreamElement<java.lang.Object> |
EMPTY |
| Modifier and Type | Method and Description |
|---|---|
static <T> @NonNull NodeStreamElement<T> |
empty()
Gets an empty node stream element.
|
default void |
ifPresent(java.util.function.Consumer<? super T> consumer)
If a value is present, invoke the specified consumer with the value, otherwise do nothing.
|
default <R> @NonNull NodeStreamElement<R> |
map(@NonNull java.util.function.Function<? super T,? extends R> mapper)
Returns a stream element consisting of the result of applying the given
function to
T. |
@NonNull java.util.Optional<T> |
optional()
Gets an optional representing
T. |
default T |
optional(T defaultValue)
Gets
T, or defaultValue. |
default T |
required()
Gets
T. |
static final NodeStreamElement<java.lang.Object> EMPTY
static <T> @NonNull NodeStreamElement<T> empty()
T - the type@NonNull java.util.Optional<T> optional()
T.default T optional(T defaultValue)
T, or defaultValue.defaultValue - the default valueTdefault T required()
T.Tdefault <R> @NonNull NodeStreamElement<R> map(@NonNull java.util.function.Function<? super T,? extends R> mapper)
T.R - the type of the new stream elementmapper - the function to apply to Tdefault void ifPresent(java.util.function.Consumer<? super T> consumer)
consumer - block to be executed if a value is present