Refactor the validator.
This commit is contained in:
+1
-1
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user