On 14 May 2014 00:04, Gary Gregory <garydgreg...@gmail.com> wrote: > IMO toes does not belong in lang. It's too much like the bean validation > framework. It has potential to leak into a giant pile of methods with support > for all doors of objects and data types. > > Providing what java 7 has in Objects should be the limit, more or less. > > Gary >
Maybe we should move in the other direction then. In 4.0 we could strip some of the more specific methods and focus on a small handful, all throwing IAE (subject to a consensus in the other thread). Several comments on the classic (now outdated) blog post comparing guava and lang [1] support that: "I find the commons validation methods a bit too specific, they somehow reminds me of the countless PHP functions, duplicating functionality only for the sake of beeing case insensitive." "Many of the methods in the Apache Commons Validate class are unnecessary and distracting… it’s a problem I have with all of the Apache Commons stuff I’ve looked at in comparison to Guava. There are just too many methods that aren’t really needed. Guava boils things down to the essentials." Perhaps, like guava, we should be returning the tested object too. Duncan [1] http://piotrjagielski.com/blog/google-guava-vs-apache-commons-for-argument-validation/ > <div>-------- Original message --------</div><div>From: Duncan Jones > <djo...@apache.org> </div><div>Date:05/13/2014 16:06 (GMT-05:00) > </div><div>To: Commons Developers List <dev@commons.apache.org> > </div><div>Subject: [lang] Any objections to LANG-1012? </div><div> > </div>Hi, > > Does anyone have any objections to me implementing > https://issues.apache.org/jira/browse/LANG-1012? The goal is to > introduce: > > Validate.isFalse() > Validate.largerThan() // isLargerThan() ?? > Validate.smallerThan() // isSmallerThan() ?? > > The isFalse() is just the natural counterpart to isTrue(), much like > JUnit added assertFalse(). The other two methods are slightly neater > ways of expressing "x >= y" or "x <= y" type constraints. Without > these, one either writes: > > Validate.isTrue(x >= y); > > or > > Validate.inclusiveBetween(y, Long.MAX_VALUE, x); > > Neither of which is as concise as it could be. > > Duncan > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org