Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. trait ISearchKey {
  2. var id:String = ""
  3. }
  4.  
  5. val fld = new CrystalFieldInfo("Field1") with ISearchKey
  6. fld.id = "Id1"
  7. implicit val formats = Serialization.formats(NoTypeHints)
  8. val ser = write[CrystalFieldInfo with ISearchKey](fld)
  9. println(ser)
  10.  
  11. implicit val formats = DefaultFormats + FieldSerializer[ISearchKey]
  12. val ser = write[CrystalFieldInfo with ISearchKey]
  13. println(ser) // should include the "id" field from the ISearchKey trait
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement