- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: Scala Enumeration
Wed, 2012-02-15, 12:11
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
https://gist.github.com/1835099