[jira] [Commented] (LANG-470) Add containsAll methods to ArrayUtils

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (LANG-470) Add containsAll methods to ArrayUtils

Sebb (Jira)

    [ https://issues.apache.org/jira/browse/LANG-470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13065697#comment-13065697 ]

Matt Benson commented on LANG-470:
----------------------------------

Just for containsAll... this is a Collection method, to be precise, so it is still pretty short, even with the null checks:

{{Arrays.asList(ArrayUtils.nullToEmpty(array1)).containsAll(Arrays.asList(ArrayUtils.nullToEmpty(array2)))}}

--even shorter with static imports.  On the whole the commons team doesn't seem to favor this, myself included.

> Add containsAll methods to ArrayUtils
> -------------------------------------
>
>                 Key: LANG-470
>                 URL: https://issues.apache.org/jira/browse/LANG-470
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.*
>    Affects Versions: 2.4
>            Reporter: Maarten Coene
>             Fix For: 3.x
>
>         Attachments: ArrayUtilsContainsAll.pat
>
>
> The ArrayUtils class contains several "contains" methods.
> It could be usefull to add the corresponding containsAll(Object[] array1, Object[] array2) methods (and corresponding for primitive types).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira