-
Enhancement
-
Resolution: Duplicate
-
P4
-
8, 9
-
None
Define a SPI so that developers can implement their own intermediate and terminal stream operations and apply them to a stream pipeline.
The Stream interface currently defines a fixed set of intermediate and terminal operations. While it is possible to augment those operations over time with additional operations (such as takeWhile/dropWhile not present in Java 8 that will be present in Java 9) it not possible nor necessary desirable to add specialized operations for particular use-cases.
Such an SPI is currently difficult to define due to the complexity of supporting reference types and the three primitive types (int, long and double). That complexity is likely to bubble up into an such SPI. With the advent of generics over primitives post Java 9 such an SPI is likely to be simpler (as underlying stream implementation will also be simpler). Thus it is proposed this feature be defined post Java 9 when generics over primitives are supported by the Java platform.
The Stream interface currently defines a fixed set of intermediate and terminal operations. While it is possible to augment those operations over time with additional operations (such as takeWhile/dropWhile not present in Java 8 that will be present in Java 9) it not possible nor necessary desirable to add specialized operations for particular use-cases.
Such an SPI is currently difficult to define due to the complexity of supporting reference types and the three primitive types (int, long and double). That complexity is likely to bubble up into an such SPI. With the advent of generics over primitives post Java 9 such an SPI is likely to be simpler (as underlying stream implementation will also be simpler). Thus it is proposed this feature be defined post Java 9 when generics over primitives are supported by the Java platform.
- duplicates
-
JDK-8319123 Implement JEP 461: Stream Gatherers (Preview)
- Resolved
- relates to
-
JDK-8132367 Alternatives to terminal operations for the Stream API
- Closed