Skip to content

Instantly share code, notes, and snippets.

@jeantessier
Last active August 29, 2015 14:03
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 jeantessier/50defa2bec044d091dfc to your computer and use it in GitHub Desktop.
Save jeantessier/50defa2bec044d091dfc to your computer and use it in GitHub Desktop.
Example of stripped down notation for Groovy, compared to Java.
import org.apache.commons.lang.StringUtils
class CopyMatcher {
def triggerWord
def matches(product) {
product.productCopy.any { StringUtils.containsIgnoreCase it.copy, triggerWord }
}
}
@jeantessier
Copy link
Author

Some advantages:

  • code blocks
  • optional parentheses
  • type-less fields
  • type-less parameters
  • default visibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment