Simplest way to use Java's unmodifiable List classes #3239
Closed
julianhowarth
started this conversation in
General
Replies: 1 comment 1 reply
-
|
just use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is really basic but I'm missing something about the best way to serialize/deserialize a
Listof objects. The following shows what I'm hitting but I can't see an answer in the docs:It fails with:
using version
0.14.1In my actual use case the list is being generated from a
stream.map(...) ... .toList()and we prefer immutable types so I can't just switch to anArrayListfor example. I've noticed that an array would work fine too , but I'd prefer not to have to incur the conversion/copy cost each time it is called.Is there a simple solution to allow this to work?
Beta Was this translation helpful? Give feedback.
All reactions