API question/request: Array to Stream
Millies, Sebastian
Sebastian.Millies at softwareag.com
Tue Oct 1 06:24:35 PDT 2013
Why can't I stream an array? It is awkward having to convert to a list first, cf.
this code by Venkat Subramaniam:
public void setFilters(Function<Color, Color>... filters) {
this.filter =
Arrays.asList(filters).stream() // <----
.reduce((f, next) -> f.compose(next))
.orElse(Function.<Color>identity());
}
Sebastian Millies
Software AG
Expert webMethods Business Analytics
Phone: +49 681 210-3221 | Fax: +49 681 210-1801
Software AG
Altenkesseler Str. 17 | 66115 Saarbrücken | Germany
www.softwareag.com<http://www.softwareag.com>
Software AG - Sitz/Registered office: Uhlandstraße 12, 64297 Darmstadt, Germany - Registergericht/Commercial register: Darmstadt HRB 1562 - Vorstand/Management Board: Karl-Heinz Streibich (Vorsitzender/Chairman), Dr. Wolfram Jost, Arnd Zinnhardt; - Aufsichtsratsvorsitzender/Chairman of the Supervisory Board: Dr. Andreas Bereczky - http://www.softwareag.com
More information about the lambda-dev
mailing list