I have a java.util.ArrayList
returned by a library. As soon as I receive the object I would like to convert it to a vavr collection.
What should I use to minimize the computations for this? I don't have a clear scenario of usage after that.
- The first thing that comes to mind is to use
io.vavr.collection.Iterator.ofAll(x)
but this will be optimum only if I will iterate. - Using a
io.vavr.collection.Vector
orio.vavr.collection.Array
will instantiate vavr collections.
What should I use? These might be called views (not wrappers). There are any guidelines on how to properly interoperate between java and vavr collections with minimal friction/computation - eventually only when is needed?
Update
The question looks similar to Lazy view of java.util.Collection in Vavr