Decorates another Collection to validate that additions
match a specified predicate.
This collection exists to provide validation for the decorated collection.
It is normally created to decorate an empty collection.
If an object cannot be added to the collection, an IllegalArgumentException is thrown.
One usage would be to ensure that no null entries are added to the collection.
Collection coll = PredicatedCollection.decorate(new ArrayList(), NotNullPredicate.INSTANCE);
This class is Serializable from Commons Collections 3.1.
since: Commons Collections 3.0 version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $ author: Stephen Colebourne author: Paul Jack |