Skip to content
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

api: Add Audience.toAudience() #156

Merged
merged 1 commit into from
Oct 10, 2020

Conversation

astei
Copy link
Contributor

@astei astei commented Sep 14, 2020

This arose out of somewhat related discussion that led to #155 being filed, but it's not related.

This API adds a collector for Audiences. It is a convenient and idiomatic shorthand for Audience.of(stream.collect(Collectors.toList())) and is more concise: stream.collect(Audience.toAudience())

*
* @return a collector to create a forwarding audience
*/
static @NonNull Collector<? super Audience, Collection<Audience>, ForwardingAudience> toAudience() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static @NonNull Collector<? super Audience, Collection<Audience>, ForwardingAudience> toAudience() {
static @NonNull Collector<? super Audience, Collection<Audience>, ForwardingAudience> collector() {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm -1 on this, it makes static imports too hard to read: stream.collect(collector()) is probably quite confusing. stream.collect(toAudience()) is unambiguous.

@astei astei changed the title api: Add Audience.toAudience() collector api: Add Audience.collector() Sep 15, 2020
@astei astei changed the title api: Add Audience.collector() api: Add Audience.toAudience() Oct 10, 2020
@kashike kashike added this to the 4.0.0 milestone Oct 10, 2020
@kashike kashike self-assigned this Oct 10, 2020
@kashike kashike merged commit 2a30fe9 into KyoriPowered:master Oct 10, 2020
zml2008 pushed a commit that referenced this pull request Dec 7, 2021
Resolves #156. I swear I did this before but i guess it got lost in the rebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants