Converting non-generic List type to Generic List type in Java 1.5

Posted by Shaun F on Stack Overflow See other posts from Stack Overflow or by Shaun F
Published on 2009-09-30T15:43:14Z Indexed on 2010/06/18 2:03 UTC
Read the original article Hit count: 315

Filed under:
|
|
|

I have a List that is guaranteed to contain just one type object. This is created by some underlying code in a library that I cannot update. I want to create a List<ObjectType> based on the incoming List object so that my calling code is talking to List<ObjectType>.

What's the best way to convert the List (or any other object collection) to a List<ObjectType>.

© Stack Overflow or respective owner

Related posts about java

Related posts about generics