Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait ISearchKey {
- var id:String = ""
- }
- val fld = new CrystalFieldInfo("Field1") with ISearchKey
- fld.id = "Id1"
- implicit val formats = Serialization.formats(NoTypeHints)
- val ser = write[CrystalFieldInfo with ISearchKey](fld)
- println(ser)
- implicit val formats = DefaultFormats + FieldSerializer[ISearchKey]
- val ser = write[CrystalFieldInfo with ISearchKey]
- println(ser) // should include the "id" field from the ISearchKey trait
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement