Skip to content

Instantly share code, notes, and snippets.

@scottashipp
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottashipp/b772414a58d519bdcd63 to your computer and use it in GitHub Desktop.
Save scottashipp/b772414a58d519bdcd63 to your computer and use it in GitHub Desktop.
Builder pattern example, validation rule
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