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

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

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


   So... problem solved then? You can do:
   
   Arrays.asList("foo", "bar").contains(someObject.getSomeGetter())
   
   Instead of:
   
   ObjectUtils.equalsAny(someObject.getSomeGetter(), "foo", "bar");
   
   In one case you build an array, in the other a list.
   


-- 
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: 693429)
    Time Spent: 1h 20m  (was: 1h 10m)

> 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 20m
>  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