Skip to content

Instantly share code, notes, and snippets.

@jeffbowman
Last active August 29, 2015 14:01
Show Gist options
  • Save jeffbowman/efe228175bc9c99daadc to your computer and use it in GitHub Desktop.
Save jeffbowman/efe228175bc9c99daadc to your computer and use it in GitHub Desktop.
ConfluexBlogPredicateExample1
Predicate<String> notNullNorEmpty = s -> s != null && !s.isEmpty();
Predicate<String> isFull = s -> s.matches("\\S+");
Predicate<String> isIntegral = s -> s.matches("\\d+");
Predicate<String> isDecimal = s -> s.matches("\\d+\\.\\d+");
Predicate<String> isNumeric = isIntegral.or(isDecimal);
Predicate<String> notNullNumeric = notNullNorEmpty.and(isNumeric);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment