singhbaljit commented on code in PR #1860:
URL: https://github.com/apache/commons-lang/pull/1860#discussion_r4529235158


##########
src/main/java/org/apache/commons/lang3/function/Consumers.java:
##########
@@ -39,16 +40,31 @@ public class Consumers {
      * @param <T>      the type of the argument the consumer accepts.
      * @since 3.15.0
      */
-    public static <T> void accept(final Consumer<T> consumer, final T object) {
+    public static <T> void accept(final Consumer<? super T> consumer, final T 
object) {
         if (consumer != null) {
             consumer.accept(object);
         }
     }
 
+    /**
+     * Applies the given {@link Consumer} action to the object if the object 
is not {@code null}. Otherwise, does nothing.
+     *
+     * @param <T>      the type of the argument the consumer accepts.
+     * @param object   The object to be consumed.
+     * @param consumer The consumer to consume.
+     * @see Functions#applyNonNull(Object, Function)
+     * @since 3.22.0
+     */
+    public static <T> void acceptNonNull(final T object, final Consumer<? 
super T> consumer) {

Review Comment:
   The signature and implementation matches the existing 
`Functions#applyNonNull(Object, Function)`.



-- 
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]

Reply via email to