Interface Gatherer.Downstream<T>
- Type Parameters:
T- the type of elements this downstream accepts
- Enclosing interface:
Gatherer<T,A, R>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface Gatherer.Downstream<T>
A Downstream object is the next stage in a pipeline of operations, to which elements can be sent.
- Since:
- 24
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
default boolean |
isRejecting() |
Checks whether the next stage is known to not want any more elements sent to it. |
boolean |
push |
Pushes, if possible, the provided element downstream -- to the next stage in the pipeline. |
Method Details
push
boolean push(T element)
Pushes, if possible, the provided element downstream -- to the next stage in the pipeline.
- Implementation Requirements:
- If this method returns
falsethen no further elements will be accepted and subsequent invocations of this method will returnfalse. - Parameters:
-
element- the element to push downstream - Returns:
-
trueif more elements can be sent, andfalseif not.
isRejecting
default boolean isRejecting()
Checks whether the next stage is known to not want any more elements sent to it.
- API Note:
- This is best-effort only, once this returns
trueit should never returnfalseagain for the same instance. - Implementation Requirements:
- The implementation in this interface returns
false. - Returns:
-
trueif this Downstream is known not to want any more elements sent to it,falseif otherwise
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.