Re: Why does the Db operations return an unmodifiable list?
Mar 31, 2012 12:09 PM
Posted in group:
It defends against inadvertently changing its state.
It just returns the list in an immutable form. Immutables have many benefits (see Effective Java for more details). Many of the classes in web4j are immutable.
Changing the returned list to a mutable form is a one-liner, something like:
List<Thing> newList = new ArrayList<Thing>(oldList);