Stay organized with collections
Save and categorize content based on your preferences.
Gatherer.Downstream
public
static
interface
Gatherer.Downstream
java.util.stream.Gatherer.Downstream<T>
|
A Downstream object is the next stage in a pipeline of operations,
to which elements can be sent.
Summary
Public methods |
default
boolean
|
isRejecting()
Checks whether the next stage is known to not want
any more elements sent to it.
|
abstract
boolean
|
push(T element)
Pushes, if possible, the provided element downstream -- to the next
stage in the pipeline.
|
Public methods
isRejecting
public 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
true
it
should never return false
again for the same instance.
Implementation Requirements:
- The implementation in this interface returns
false
.
Returns |
boolean |
true if this Downstream is known not to want any
more elements sent to it, false if otherwise |
push
public abstract boolean push (T element)
Pushes, if possible, the provided element downstream -- to the next
stage in the pipeline.
Implementation Requirements:
- If this method returns
false
then no further
elements will be accepted and subsequent invocations of this method
will return false
.
Parameters |
element |
T : the element to push downstream |
Returns |
boolean |
true if more elements can be sent,
and false if not. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[],[],null,["# Gatherer.Downstream\n\n[**Added in Android Baklava**](/preview) \n\nGatherer.Downstream\n===================\n\n\n`\npublic\nstatic\n\n\ninterface\nGatherer.Downstream\n`\n\n\n`\n\n\n`\n\n|-------------------------------------------|\n| java.util.stream.Gatherer.Downstream\\\u003cT\\\u003e |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA Downstream object is the next stage in a pipeline of operations,\nto which elements can be sent.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` default boolean` | ` `[isRejecting](/reference/java/util/stream/Gatherer.Downstream#isRejecting())`() ` Checks whether the next stage is known to not want any more elements sent to it. |\n| ` abstract boolean` | ` `[push](/reference/java/util/stream/Gatherer.Downstream#push(T))`(T element) ` Pushes, if possible, the provided element downstream -- to the next stage in the pipeline. |\n\nPublic methods\n--------------\n\n### isRejecting\n\n[**Added in Android Baklava**](/preview) \n\n```\npublic boolean isRejecting ()\n```\n\nChecks whether the next stage is known to not want\nany more elements sent to it.\n\n\u003cbr /\u003e\n\n##### API Note:\n\n- This is best-effort only, once this returns `true` it should never return `false` again for the same instance. \n\n##### Implementation Requirements:\n\n- The implementation in this interface returns `false`.\n\n| Returns ||\n|-----------|----------------------------------------------------------------------------------------------------------|\n| `boolean` | `true` if this Downstream is known not to want any more elements sent to it, `false` if otherwise \u003cbr /\u003e |\n\n### push\n\n[**Added in Android Baklava**](/preview) \n\n```\npublic abstract boolean push (T element)\n```\n\nPushes, if possible, the provided element downstream -- to the next\nstage in the pipeline.\n\n\u003cbr /\u003e\n\n##### Implementation Requirements:\n\n- If this method returns `false` then no further elements will be accepted and subsequent invocations of this method will return `false`.\n\n| Parameters ||\n|-----------|--------------------------------------------|\n| `element` | `T`: the element to push downstream \u003cbr /\u003e |\n\n| Returns ||\n|-----------|-----------------------------------------------------------------|\n| `boolean` | `true` if more elements can be sent, and `false` if not. \u003cbr /\u003e |"]]