scala - (de)serialize class to/from JSON -
reasonably new scala, i'm looking way serialize , deserialize class to/from json. i'm familiar jackson annotations java, , use style if makes sense in scala.
two parts causing me problems: private constructor parameters, , hashsets.
i've tried json4s , jackson-module-scala, seem able them want. both reported errors hashsets. sorry, don't have errors handy, can find if necessary.
as test, here's class i'm trying serialize deserialize:
class foo(val public: string, private: string) { somelist: mutable.hashmap[string] = new mutable.hashmap[string]("bar") def func = { .. } }
thanks help!
did try using case classes? otherwise think there annotation make class compatible pojo classes @beanproperty. can find more here https://twitter.github.io/scala_school/java.html
Comments
Post a Comment