I would like to know if there's an equivalent for BeanComparator from Commons BeanUtils which would allow using generics (and also wouldn't rely on Commons Collections).
The 1.9.x version of commons-beanutils is generics compatible. Just update to the current release version (1.9.2 as of June 2014) and you will have what you desire. http://commons.apache.org/proper/commons-beanutils/apidocs/org/apache/commons/beanutils/BeanComparator.html
You can download it here or use the maven artifacts. http://commons.apache.org/proper/commons-beanutils/
That said, it is generally better to not use this reflection mechanism because the performance hit and loss of control will probably not be worth the minor savings in lines of code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With