Skip to content

Commit 412330d

Browse files
author
Daniel Reigada
committed
feature: Add unapply method to pattern specification
1 parent 66c76ce commit 412330d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/scala/com/codacy/plugins/api/results/Pattern.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ object Pattern {
4646
languages: Option[Set[Language]] = None)
4747
extends Specification
4848

49+
def unapply(s: Pattern.Specification): Option[(Pattern.Id,
50+
Result.Level,
51+
Category,
52+
Option[Subcategory],
53+
Option[Set[Parameter.Specification]],
54+
Option[Set[Language]])] = s match {
55+
case si: SpecificationImpl =>
56+
SpecificationImpl.unapply(si)
57+
}
58+
4959
def apply(patternId: Pattern.Id,
5060
level: Result.Level,
5161
category: Category,

0 commit comments

Comments
 (0)