General discussion

Locked

Implement a BeanComparator

By Mark W. Kaelin Editor ·
The Dec. 9, Java TechMail discusses the Jakarta Commons BeanComparator. Have you used the BeanComparator in your Java application development? Tell us about your experience.

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

BeanUtils

by bayard In reply to Implement a BeanComparato ...

Note: Jakarta Commons BeanUtils now has such a BeanComparator in its API [In fact, very like it as it came from the code that lead to the tip and separate work from Eric Pugh].

This can be found at:
http://jakarta.apache.org/commons/beanutils.html
and the API seen at:
http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanutils/BeanComparator.html

Expect a getComparator/setComparator pair of methods to be added in the next release.

I've often found it hard to get people to click as to how useful BeanComparator is. Once it clicks, it clicks, but until then it's hard to convince people that BeanComparator does away with 95% of your comparators :)

[Also, pay attention to ReverseComparator in the Commons Collections project. Much nicer than using ASC/DESC flags]

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums