gsmiller commented on code in PR #15823:
URL: https://github.com/apache/lucene/pull/15823#discussion_r2968342388
##########
lucene/core/src/java/org/apache/lucene/util/PriorityQueue.java:
##########
@@ -174,6 +179,32 @@ public void addAll(Collection<T> elements) {
}
}
+ /**
+ * Similar to {@link #addAll(Collection)}, but supply an {@link
ElementSupplier} to convert origin
+ * element to target element. This is useful when source elements does not
fit target elements.
+ */
+ public <S> void addAll(Collection<S> elements, ElementSupplier<T, S>
elementSupplier) {
Review Comment:
I suspect the idea here would be:
1. Not use a 3rd party library directly (we don't want that dependency in
core)
2. Have an addAll method that simply takes a `java.lang.Iterable` as a
single input but create our own implementation of `Iterable` that applies the
transformation internally. Much like what Guava's `Iterables#transform` method
does. This is probably something we'd put in core (maybe in o.a.l.util)? We
could probably deprecate the current addAll method that takes a Collection in
favor of this new API as well.
This approach makes a lot of sense to me, and I don't think it would be too
much work to do. (Hopefully I'm understanding the suggestion correctly).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]