[ 
https://issues.apache.org/jira/browse/LANG-1666?focusedWorklogId=693379&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-693379
 ]

ASF GitHub Bot logged work on LANG-1666:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Dec/21 16:33
            Start Date: 09/Dec/21 16:33
    Worklog Time Spent: 10m 
      Work Description: felhag commented on pull request #782:
URL: https://github.com/apache/commons-lang/pull/782#issuecomment-990016575


   I see, but I think it doesn't fully replace functionality for 
`ObjectUtils.equalsAny`. In my opinion building an inline array creates a lot 
of clutter, for example: 
   `ArrayUtils.containsAny(new String[] {"foo", "bar"}, 
someObject.getSomeGetter());`
   vs
   `ObjectUtils.equalsAny(someObject.getSomeGetter(), "foo", "bar");`
   
   In that case I think I would prefer something like `Arrays.asList("foo", 
"bar").contains(someObject.getSomeGetter())`. 
   


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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 693379)
    Time Spent: 1h 10m  (was: 1h)

> Add ObjectUtils.equalsAny
> -------------------------
>
>                 Key: LANG-1666
>                 URL: https://issues.apache.org/jira/browse/LANG-1666
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Felix Hagemans
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> I think an {{equalsAny}} utility method would be a nice simple addition to 
> the ObjectUtils class. For example: 
> {code:java}if (valueA.equals(someObject.getSomeGetter()) || 
> valueB.equals(someObject.getSomeGetter()) { ... }{code}
> could be written a lot cleaner: 
> {code:java}if (ObjectUtils.equalsAny(someObject.getSomeGetter(), valueA, 
> valueB) { ... }{code}
> It would work similar to the already existing StringUtils.equalsAny method. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to