conversion between case class and vector