object methods in case class

Hi,

anybody has shortcut syntax for following code? I feel that there
must be some way how to extend "object" part easily than decleare it
separately?

object MyCaseClass extends SomeOtherObject {
def convertToOtherObject(cc:MyCaseClass) = {
... some magic ...
}
}

case class MyCaseClass(par:String)

Thanks

Pavel

Re: object methods in case class

it's not clear to me what you want. why don't you simply put the
convert-method into the case class?

Am 10.01.2012 16:24, schrieb Pavel Chlupáček:
> Hi,
>
> anybody has shortcut syntax for following code? I feel that there
> must be some way how to extend "object" part easily than decleare it
> separately?
>
> object MyCaseClass extends SomeOtherObject {
> def convertToOtherObject(cc:MyCaseClass) = {
> ... some magic ...
> }
> }
>
> case class MyCaseClass(par:String)
>
> Thanks
>
> Pavel
>

Copyright © 2013 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland