title: Scala case class with argument type change at runtime
body: <p>Scala Issue:
  JSON data is extracted and stored into case class, the time string data needs to be converted to sql timestamp for
  Spark dataframe and to Java/Joda Date for Salat DAO/Mongo DB store.</p>
  
  <p>And both don't support each other format.</p>
  
  <p>Currently we are using two case class for same:</p>
  
  <pre><code>case class A(a:int,  b:string, time:java.sql.timestamp)
  case class B(a:int, b:string, time:java.util.Date)
  </code></pre>
  
  <p>So an Json Extractor method populates either of the above two case class based on the store type Spark/Mongo</p>
  
  <p>Is there a better way to handle this ? (composite class is one way but again it gets too nested)</p>
  
  <p>Do Note, the case class can even be Nested, (A containing C and D, which in turn can have time arguments within them)</p>