You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/GenCodec.md
+4-9Lines changed: 4 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -94,11 +94,10 @@ The library by default provides codecs for common Scala and Java types:
94
94
* Any `Array[T]`, provided that `T` can be serialized
95
95
* Any Scala collection extending `scala.collection.Seq[T]` or `scala.collection.Set[T]`, provided that `T` can be serialized
96
96
* Any `java.util.Collection[T]`, provided that `T` can be serialized
97
-
* Any `scala.collection.Map[K,V]` provided that `K` and `V` can be serialized. By default, maps are serialized as lists
98
-
of key-value pairs, unless there is an implicit `GenKeyCodec` available for the key type `K` (see later).
99
-
In that case, keys can be represented as `String`s and the map can be serialized as an object.
100
-
* Any `java.util.Map[K,V]`, provided that `K` and `V` can be serialized. [`GenKeyCodec`](http://avsystem.github.io/scala-commons/api/com/avsystem/commons/serialization/GenKeyCodec.html)
101
-
existence for `K` applies in the same way as for Scala `Map`.
97
+
* Any `scala.collection.Map[K,V]` provided that `V` can be serialized and there is an implicit
98
+
[`GenKeyCodec`](http://avsystem.github.io/scala-commons/api/com/avsystem/commons/serialization/GenKeyCodec.html) available for `K`
99
+
so that it can be converted to a string and used as object key.
100
+
* Any `java.util.Map[K,V]`, with the same restrictions as for Scala maps (there must be `GenCodec` for `V` and `GenKeyCodec` for `K`)
102
101
*`Option[T]`, `Opt[T]`, `OptArg[T]`, `NOpt[T]`, `OptRef[T]`, provided that `T` can be serialized.
103
102
*`Either[A,B]`, provided that `A` and `B` can be serialized.
If there is no [`GenKeyCodec`](http://avsystem.github.io/scala-commons/api/com/avsystem/commons/serialization/GenKeyCodec.html)
122
-
available for some type `K`, then `Map[K,V]` will be serialized into a list of key-value
123
-
pairs (each pair represented as an object with two fields).
124
-
125
120
## Serializing and deserializing examples
126
121
127
122
To serialize and deserialize values, you can use the [`read`](http://avsystem.github.io/scala-commons/api/com/avsystem/commons/serialization/GenCodec.html#read(input:com.avsystem.commons.serialization.Input):T)
0 commit comments