Re: Scala case-classes and things without no-arg ctrs

311 views
Skip to first unread message

Timothy Perrett

unread,
Dec 31, 2012, 1:03:32 PM12/31/12
to kryo-...@googlegroups.com
BTW, I should say, using the custom serilizers does work - I'm just looking for advice as if this is the path to take or if there is some more automatic way of working?

Thanks, Tim 

On Sunday, 30 December 2012 20:13:14 UTC-8, Timothy Perrett wrote:
Hey guys,

So i'm just playing with Kryo, and I threw this together: https://gist.github.com/4417294

However, whenever I try to deserilize, I get: com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg constructor): demo.User. From what i've read, this is because there's no zero-arg constructor. Given that case classes are immutable, and not designed to be used with a no-arg ctr, what's the best strategy here? It feels boilerplate to write a custom serilizer for every case class I want to use...

What's the recommended path? 

Thanks, Tim 

Sam Ritchie

unread,
Jan 1, 2013, 3:56:00 AM1/1/13
to kryo-...@googlegroups.com
Hey Tim,

Chill has native support for case classes and all other scala data structures:


Happy new year!
Sam

--
Sam Ritchie
703.662.1337
@sritchie

--
You received this message because you are subscribed to the "kryo-users" group.
http://groups.google.com/group/kryo-users

Reply all
Reply to author
Forward
0 new messages