calrissian / mango

Common utilities for rapid application development
Apache License 2.0
17 stars 7 forks source link

CloseableIterables needs a toList() or toCollection method #184

Closed cjnolet closed 9 years ago

eawagner commented 9 years ago

You an already do this with Lists.newArrayList(...) or Sets.newHashSet(...).

CloseableIterables are designed to be able be iterated against multiple times so you could theoretically create multiple collections from the same data as long as you didn't close that Iterable. If you only wanted one use your iterable once however you could always do, Lists.newArrayList(CloseableIterables.autoClose(...));

eawagner commented 9 years ago

I think we should close this. I don't think CloseableIterables needs a dedicated method for this.