bindul commented on a change in pull request #684:
URL: https://github.com/apache/commons-lang/pull/684#discussion_r549495161
##########
File path: src/main/java/org/apache/commons/lang3/ObjectUtils.java
##########
@@ -226,6 +227,62 @@ public static boolean anyNotNull(final Object... values) {
return firstNonNull(values) != null;
}
+ /**
+ * <p>
+ * Invokes the given {@code consumer's} {@link Consumer#accept(Object)}
with the first {@code non-null} value from
+ * {@code objects}. If all the values are null, the consumer is not
invoked.
+ * </p>
+ *
+ * <p>
+ * The caller is responsible for thread-safety and exception handling of
consumer.
+ * </p>
+ *
+ * <pre>
+ * ObjectUtils.applyIfNonNull(bean::setValue, null) -
setValue not invoked
Review comment:
Corrected, thanks.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]