0

It extends Edge, which is a case class, but EdgeTriplet isn't, and it doesn't implement unapply. I wonder if there is a way to do pattern matching, e.g.

t:EdgeTriplet[Foo,Bar] match {
  case EdgeTriplet(src, dst, edgeAttr) => ...
}
Eran Medan
  • 44,555
  • 61
  • 184
  • 276

1 Answers1

0

Just do like the following

(t:EdgeTriplet[Foo,Bar]) => (t.srcId, t.dstId, t.edgeAttr) match{
  case (0, 1, edgeAttr) =>
  case (stcId, dstId, edgeAttr) if ... => ...
  case _ => Unit
}
ponkin
  • 2,363
  • 18
  • 25