Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save andresteingress/436886 to your computer and use it in GitHub Desktop.

Select an option

Save andresteingress/436886 to your computer and use it in GitHub Desktop.
@Grab(group='org.gcontracts', module='gcontracts', version='[1.1.0,)')
import org.gcontracts.annotations.Invariant
@Invariant({ firstName != null && lastName != null })
class Person {
String firstName
String lastName
def Person(final String firstName, final String lastName) {
this.firstName = firstName
this.lastName = lastName
}
def String toString () { firstName + ' ' + lastName }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment