You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Felix Hagemans (Jira)" <ji...@apache.org> on 2021/07/28 18:29:00 UTC

[jira] [Created] (LANG-1666) Add ObjectUtils.equalsAny

Felix Hagemans created LANG-1666:
------------------------------------

             Summary: 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


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.3.4#803005)