[
https://issues.apache.org/jira/browse/LANG-1421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16623773#comment-16623773
]
ASF GitHub Bot commented on LANG-1421:
--------------------------------------
Github user andyklimczak commented on a diff in the pull request:
https://github.com/apache/commons-lang/pull/357#discussion_r219537218
--- Diff: src/main/java/org/apache/commons/lang3/ObjectUtils.java ---
@@ -236,6 +236,39 @@ public static boolean anyNotNull(final Object...
values) {
return firstNonNull(values) != null;
}
+ /**
+ * Checks if any value in the given array is {@code null}.
+ *
+ * <p>
+ * If none of the values are {@code null} or the array is {@code null}
+ * or empty then {@code false} is returned. Otherwise {@code true} is
returned.
+ * </p>
+ *
+ * <pre>
+ * ObjectUtils.anyNull(*) = false
+ * ObjectUtils.anyNull(*, null) = true
+ * ObjectUtils.anyNull(null, *) = true
+ * ObjectUtils.anyNull(null, null, *, *) = true
+ * ObjectUtils.anyNull(null) = true
+ * ObjectUtils.anyNull(null, null) = true
+ * ObjectUtils.anyNull() = false
+ * ObjectUtils.anyNull((Object[]) null) = false
+ * </pre>
+ *
+ * @param values the values to test, may be {@code null} or empty
+ * @return {@code true} if there is at least one null value in the
array,
+ * {@code false} if all values in the array are not {@code null}s.
+ * If the array is {@code null} or empty {@code fatolse} is also
returned.
--- End diff --
depending on how you feel, you could replace the `if the array is {@code
null}` info with something about this method being null safe (to keep the
wordage the same as other methods that use `null safe`)
> Add anyNull(Object ...) to ObjectUtils
> --------------------------------------
>
> Key: LANG-1421
> URL: https://issues.apache.org/jira/browse/LANG-1421
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 3.8
> Reporter: Sandra Parsick
> Priority: Minor
>
> We looked for
> {code:java}
> ObjectUtils.anyNull(Object ...)
> {code}
> We found LANG-781 but when we look in the Pull Request, we found methods like
> anyNotNull and allNotNull.
> We would still like to add anyNull and allNull as opposite of these.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)