Add support to Java 8 Streams #962

Closed
svpace opened this Issue Nov 19, 2016 · 2 comments

Projects

None yet

4 participants

@svpace
svpace commented Nov 19, 2016

Add support for stream attributes. Allowing mappings like:
class From { public Stream<Foo> getFoos() {...} }
to
class To { public void setBars(Stream<Bar> bars) {...} }
or even
class To { public void setBars(Set<Bar> bars) {...} }
by applying the proper Collector

@agudian
Member
agudian commented Nov 21, 2016

Hmm, interesting! It would probably make sense to generate the fluent kind of mapping with method references, such as to.setBars( from.getFoos().map( this::toBar ) );...
The Stream to Collection conversion could be done by adding appropriate built-in Conversions (again, for in-line usage).
Especially that last part shouldn't be too hard to get started with (in the code it's somehow similar to our numeric conversions). Would you care to try it and prepare a PR?

@filiphr filiphr added a commit to filiphr/mapstruct that referenced this issue Nov 22, 2016
@filiphr filiphr #962 add conversions between Java 8 Stream and the different Java Col…
…lection and Iterable types
9eba96b
@filiphr filiphr added a commit to filiphr/mapstruct that referenced this issue Nov 22, 2016
@filiphr filiphr #962 add conversions between Java 8 Stream and the different Java Col…
…lection and Iterable types
6a21049
@gunnarmorling gunnarmorling added this to the 1.2.x milestone Dec 12, 2016
@filiphr filiphr added a commit to filiphr/mapstruct that referenced this issue Dec 20, 2016
@filiphr filiphr #962 add support for mapping between Java 8 Stream and the different …
…Java Collection and Iterable types
a48dcf0
@filiphr filiphr closed this Dec 22, 2016
@filiphr filiphr reopened this Dec 22, 2016
@filiphr filiphr added a commit to filiphr/mapstruct that referenced this issue Dec 26, 2016
@filiphr filiphr #962 add support for mapping between Java 8 Stream and the different …
…Java Collection and Iterable types
5587f54
@filiphr filiphr added a commit to filiphr/mapstruct that referenced this issue Jan 6, 2017
@filiphr filiphr #962 add support for mapping between Java 8 Stream and the different …
…Java Collection and Iterable types
6d0d220
@filiphr
Member
filiphr commented Jan 6, 2017

Support for this was added in #964

@filiphr filiphr closed this Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment