commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil O'Toole <>
Subject [collections][patch] LazyList decorator default factory
Date Sat, 26 Jul 2003 22:23:22 GMT

In general, decorators should strive to provide an instantiation method
of the form #decorate( decoratee ) whenever it is possible to provide
sensible defaults for the behaviour of the decorator. The attached
patch adds a method LazyList#decorate( List ) which uses the null
factory. This is a very common case, and it's much neater to do

 List lazy = LazyList.decorate( list );


 List lazy = LazyList.decorate( list, FactoryUtils.nullFactory() );

In fact, I'd written my own null factory before I discovered the one in
FactoryUtils ;), so this certainly lowers the usage-barrier for

* It should be trivial to add equivalent support for LazyMap etc..


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

View raw message