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
Due to limitation of Java generics, there is no Codec[int], only Codec[java.lang.Integer].
But also Datastax's driver won't let you define one from Scala (raises exception at Constructor).
Since, Scala compiler won't pick an implicit of M[java.lang.Integer] as M[Int]. This affected Troy implicit Codecs feature. As a solution, a hack was introduced for List and Set, to have a wrapper TroyCodec, that maps on every item on the collection to convert it from the Java Wrapper to the Scala Primitive.
But for Map, and Tuples, this hack would require order of magnitude more boilerplate. So currently they only support Wrapper classes, like Map[Integer, String]
Due to limitation of Java generics, there is no
Codec[int]
, onlyCodec[java.lang.Integer]
.But also Datastax's driver won't let you define one from Scala (raises exception at Constructor).
Since, Scala compiler won't pick an implicit of M[java.lang.Integer] as M[Int]. This affected Troy implicit Codecs feature. As a solution, a hack was introduced for List and Set, to have a wrapper TroyCodec, that
map
s on every item on the collection to convert it from the Java Wrapper to the Scala Primitive.But for Map, and Tuples, this hack would require order of magnitude more boilerplate. So currently they only support Wrapper classes, like Map[Integer, String]
See #8 and https://github.com/tabdulradi/troy/pull/17/files
The text was updated successfully, but these errors were encountered: