commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ola Berg <>
Subject Re: [reflect][collection] Predicate - a question
Date Mon, 17 Jun 2002 12:10:08 GMT
I agree with you. And I would like to elaborate, by letting Assert become a decorator for Predicate:

This class throws AssertionException if the underlying
Predicate evaluates to false.
class AssertingPredicate implements Predicate {

    private Predicate _predicate;

    public AssertingPredicate( Predicate predicate){
        _predicate = predicate;

    public boolean evaluate( Object input){
        if (!_predicate.evaluate( input)){
            throw new AssertionException( input, predicate);
            return true;

Could be a candidate for lang (where Predicate already should be IMO). Are common assertion
mechanisms discussed here before?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message