This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: Scala Enumeration

No replies
Jan Vanek
Joined: 2011-08-23,
User offline. Last seen 42 years 45 weeks ago.
The posts about enumeration are getting annoying, sorry. I've created a gist which tries to fix/improve the serialization of the enums. Whenever someone redesigns the class hopefully to provide user customizable Value classes he could still use the method. When serializing a "static object" (an object which is not nested in a class) enum only its class (boxed in private ObjectRepl class) is serialized, when serializing a value of such enum only its id (wrapped in private ValRepl class) is serialized. Other enums and their values are serialized fully.
https://gist.github.com/1835099

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland