Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import org.json4s._
  2. import org.json4s.jackson.JsonMethods._
  3. import org.json4s.jackson.Serialization.read
  4. import com.goibibo.dp.utils.Json4sCustomReaders._
  5. import com.goibibo.dp.etl.hotel.models._
  6.  
  7. implicit val formats: Formats = DefaultFormats + StringToDate + StringToTimestamp
  8.  
  9. val defaultFormat = new DefaultFormats {
  10. override def dateFormatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
  11. }
  12. implicit val formats: Formats = defaultFormat + new CustomBoolSerializer + new CustomIntSerializer + StringToDate + StringToTimestamp
  13.  
  14. val hbrStr = (parse(a) \\ "hbr").extract[String]
  15. val hbr = read[HotelRecordWithBookJson](hbrStr)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement