Here are Guava's alternatives to Apache Commons.
Not a one-to-one match, and not all bases are covered:

StringUtils, WordUtils, StringEscapeUtils: com.google.common.base:
Strings, Joiner, Splitter, CharMatcher, CaseFormat

ClassUtils: Package com.google.common.primitives,

ToStringBuilder: com.google.common.base.Objects.toStringHelper()

CompareToBuilder, EqualsBuilder:
com.google.common.collect.ComparisonChain, com.google.common.base:
Objects.equal(), Equivalence

HashCodeBuilder: Package com.google.common.hash,
com.google.common.base.Objects.hashCode()

IOUtils: Package com.google.common.io


See 
http://docs.guava-libraries.googlecode.com/git-history/v11.0/javadoc/index.html
for details


On Jan 4, 7:47 am, Joe Sondow <[email protected]> wrote:
> On Jan 3, 2:09 am, morten hattesen <[email protected]> wrote:
>
> > Out of interest: Which parts of Apache Commons do you find useful?
> > I've found that the vast majority of the "basic" Apache Commons
> > projects have gone stale (e.g. Commons Collections not even supporting
> > Java 5 Generics). Google Guava, on the other hand is actively being
> > developed and is by far the most suitable "Swiss Army Knife" library
> > that fills the gaps of the Java API.
>
> > My recommendation would thus be: Have Google Guava on your classpath
> > ALWAYS, and use the basic facilities such as Preconditions throughout
> > your code, and Function/Predicate etc when appropriate for your
> > implementation, and resort to Apache Commons for the niche libraries
> > such as Commons Email and HTTP Components (no longer an Apache commons
> > component), wheneverthey are required.
>
> That's fair. Guava is certainly more modern. Multiset with generics is
> better than Bag without generics. I still lean on Apache's
> StringUtils, StringEscapeUtils, WordUtils, ClassUtils,
> ToStringBuilder, CompareToBuilder, EqualsBuilder, HashCodeBuilder,
> IOUtils. Perhaps Guava has all those same methods and I just haven't
> found the Guava equivalents for each case yet.

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to