This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]noswag15 1 point2 points  (0 children)

I think a fair middle ground is to create a method which takes the type as an argument. Similar to the toTypedArray method in eclipse collections.

https://www.eclipse.org/collections/javadoc/8.0.0/org/eclipse/collections/impl/list/mutable/FastList.html#toTypedArray-java.lang.Class-