Class PredicatedList<E>

All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, List<E>

public class PredicatedList<E> extends PredicatedCollection<E> implements List<E>
Decorates another List to validate that all additions match a specified predicate.

This list exists to provide validation for the decorated list. It is normally created to decorate an empty list. If an object cannot be added to the list, an IllegalArgumentException is thrown.

One usage would be to ensure that no null entries are added to the list.

 
 List<String> list =
   PredicatedList.predicatedList(new ArrayList<String>(), PredicateUtils.notNullPredicate());
 
 

This class is Serializable from Commons Collections 3.1.

Since:
3.0
See Also: