Closed GoogleCodeExporter closed 9 years ago
Here's the difficulty in making it serializible. Multimap.get() returns a live
view
into the multimap, which changes when the multimap changes. How can we serialize
Multimap.get(key) for a single key, apart from serializing the entire multimap?
For
similar reasons, the views of the JDK collections, such as Map.keySet(), aren't
serializable.
However, your desire to serialize the values of a multimap key is totally
reasonable.
Since serialization doesn't seem to be technically feasible, unless we rewrite
StandardMultimap, we should add documentation explaining that the collections
returned by our Multimap.get() implementations are not serializible.
There is a simple workaround: copy the Multimap.get() values into a JDK
collection
class, which you then serialize.
Original comment by jared.l....@gmail.com
on 6 Nov 2007 at 5:33
Original comment by kevin...@gmail.com
on 6 Nov 2007 at 5:47
Documentation would be welcomed indeed. I've come to the same conclusion and
implemented what you suggested as a workaround.
May be adding a method getCopy(key) or something similar could be useful when
the
return may be sent across the network? or may be able to create a Multimap which
would return serializable lists?
Thanks for your prompt reply.
Original comment by beno...@gmail.com
on 6 Nov 2007 at 6:28
We're considering changes like those.
Thanks for your suggestions!
Original comment by jared.l....@gmail.com
on 6 Nov 2007 at 10:15
Original issue reported on code.google.com by
beno...@gmail.com
on 6 Nov 2007 at 3:49