-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Conversation
api/src/test/java/net/kyori/adventure/audience/AudienceTest.java
Outdated
Show resolved
Hide resolved
* | ||
* @return a collector to create a forwarding audience | ||
*/ | ||
static @NonNull Collector<? super Audience, Collection<Audience>, ForwardingAudience> toAudience() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static @NonNull Collector<? super Audience, Collection<Audience>, ForwardingAudience> toAudience() { | |
static @NonNull Collector<? super Audience, Collection<Audience>, ForwardingAudience> collector() { |
There was a problem hiding this comment.
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.
e8a1ece
to
a4787e1
Compare
a4787e1
to
b69acc1
Compare
Resolves #156. I swear I did this before but i guess it got lost in the rebase
This arose out of somewhat related discussion that led to #155 being filed, but it's not related.
This API adds a collector for
Audience
s. It is a convenient and idiomatic shorthand forAudience.of(stream.collect(Collectors.toList()))
and is more concise:stream.collect(Audience.toAudience())