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) => ...
}
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) => ...
}
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
}