Hi Petr, Could you please let me know if I am missing anything on the code as my code is as same as snippet shared by you but still i am getting the below error:
*error type mismatch: found String required: Serializable* Please let me know if any fix to be applied on this Regards, Satish Chandra On Sat, Oct 3, 2015 at 9:31 AM, satish chandra j <jsatishchan...@gmail.com> wrote: > Hi, > I am getting the below error while implementing the above custom class > code given by you > > error type mismatch: found String required: Serializable > > Please let me know if i am missing anything here > > Regards, > Satish Chandra > > On Wed, Sep 23, 2015 at 12:34 PM, Petr Novak <oss.mli...@gmail.com> wrote: > >> You can implement your own case class supporting more then 22 fields. It >> is something like: >> >> class MyRecord(val val1: String, val val2: String, ... more then 22, in this >> case f.e. 26) >> extends Product with Serializable { >> >> def canEqual(that: Any): Boolean = that.isInstanceOf[MyRecord] >> >> def productArity: Int = 26 // example value, it is amount of arguments >> >> def productElement(n: Int): Serializable = n match { >> case 1 => val1 >> case 2 => val2 >> //... cases up to 26 >> } >> } >> >> You can google it for more details. >> >> Petr >> > >