Assume a class (for instance URI) that is convertable to and from a String using the constructor and toString() method.
I have an ArrayList<URI>
and I want to copy it to an ArrayList<String>
, or the other way around.
Is there a utility function in the Java standard library that will do it? Something like:
java.util.collections.copy(urlArray,stringArray);
I know there are utility libraries that provide that function, but I don't want to add an unnecessary library.
I also know how to write such a function, but it's annoying to read code and find that someone has written functions that already exist in the standard library.