Skip to content

Commit 52d9908

Browse files
adamretterRadek Hubner
authored andcommitted
Remove duplicate code
1 parent 125ca54 commit 52d9908

File tree

1 file changed

+0
-7
lines changed
  • csv-validator-core/src/main/scala/uk/gov/nationalarchives/csv/validator/schema/v1_0

1 file changed

+0
-7
lines changed

csv-validator-core/src/main/scala/uk/gov/nationalarchives/csv/validator/schema/v1_0/Rule.scala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,6 @@ case class IfRule(condition: Rule, rules: List[Rule], elseRules: Option[List[Rul
9292
}
9393
}
9494

95-
abstract class PatternRule(name: String, pattern: String) extends Rule(name) {
96-
// Uses the cache to retrieve a compiled regex representation for the pattern string.
97-
override def valid(cellValue: String, columnDefinition: ColumnDefinition, columnIndex: Int, row: Row, schema: Schema, mayBeLast: Option[Boolean] = None): Boolean = {
98-
RegexCache.getCompiledRegex(pattern).matcher(cellValue).matches()
99-
}
100-
}
101-
10295
case class RegExpRule(regex: String) extends Rule("regex") {
10396
override def valid(cellValue: String, columnDefinition: ColumnDefinition, columnIndex: Int, row: Row, schema: Schema, mayBeLast: Option[Boolean] = None): Boolean = {
10497
val regexp = if (columnDefinition.directives.contains(IgnoreCase())) "(?i)" + regex else regex

0 commit comments

Comments
 (0)