data443-cboyd commented on a change in pull request #300:
URL: https://github.com/apache/commons-io/pull/300#discussion_r748686513
##########
File path: src/main/java/org/apache/commons/io/function/IOConsumer.java
##########
@@ -85,13 +150,25 @@
*/
void accept(T t) throws IOException;
+ /**
+ * Returns this {@code IOConsumer} wrapped inside of a {@link Consumer}
+ * that throws {@link UncheckedIOException} for any {@link IOException}s
+ * that are thrown by this {@code IOConsumer}.
+ *
+ * @return a {@code Consumer} that wraps this {@code IOConsumer}.
+ * @since 2.12.0
+ */
+ default Consumer<T> asConsumer() {
+ return wrap(this);
Review comment:
Hi @garydgregory , my thought process at the time was that the user may
want to override this method with their own implementation of IOConsumer, but
after considering your comments, it would be just as easy for the user who
requires a custom implementation to provide that themselves externally, and
otherwise rely on the static method for wrapping. I will remove this method.
--
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]