Refactor the validator.

This commit is contained in:
2023-10-29 14:09:12 +02:00
parent 3d0e18b22d
commit bc694a6e81
2 changed files with 10 additions and 1 deletions
@@ -4,7 +4,7 @@ import java.util.regex.Pattern;
public class InputStringFormatValidator extends Validator {
String command;
String formatRegEx = "\\w+\\s\\w+\\((|[^)]+)\\)";
String formatRegEx = "\\w+\\s\\w+\\([^)]*\\)";
public InputStringFormatValidator(String command) {
this.command = command;
@@ -0,0 +1,9 @@
package space.kklochko.jdbc_hospital_example.cli.validators;
import java.util.regex.Pattern;
abstract public class Validator {
abstract public boolean isValid();
abstract public String getMessage();
}