Last active
August 29, 2015 14:07
-
-
Save scottashipp/b772414a58d519bdcd63 to your computer and use it in GitHub Desktop.
Builder pattern example, validation rule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ValidationRule { | |
/** | |
* Return the error message for this validation rule, | |
* which can be retrieved when validate is false. | |
* | |
*/ | |
String getErrorMessage(); | |
/** | |
* Execute the logic for this validation rule and return true | |
* if valid and false if invalid. | |
*/ | |
boolean validate(String arg); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment