New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to Java 8 Streams #962

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

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

This comment has been minimized.

Show comment
Hide comment
@agudian

agudian Nov 21, 2016

Member

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?

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 added a commit to filiphr/mapstruct that referenced this issue Nov 22, 2016

filiphr added a commit to filiphr/mapstruct that referenced this issue Nov 22, 2016

filiphr added a commit to filiphr/mapstruct that referenced this issue Nov 23, 2016

@gunnarmorling gunnarmorling added this to the 1.2.x milestone Dec 12, 2016

filiphr added a commit to filiphr/mapstruct that referenced this issue Dec 20, 2016

@filiphr filiphr closed this Dec 22, 2016

@filiphr filiphr reopened this Dec 22, 2016

filiphr added a commit to filiphr/mapstruct that referenced this issue Dec 26, 2016

filiphr added a commit to filiphr/mapstruct that referenced this issue Jan 6, 2017

@filiphr

This comment has been minimized.

Show comment
Hide comment
@filiphr

filiphr Jan 6, 2017

Member

Support for this was added in #964

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