Skip to content

Instantly share code, notes, and snippets.

@krisskross
Created May 18, 2012 16:58
Show Gist options
  • Save krisskross/2726401 to your computer and use it in GitHub Desktop.
Save krisskross/2726401 to your computer and use it in GitHub Desktop.
public Item(String id, String name) {
this.id = Preconditions.checkNotNull(id, "id must not be null");
this.name = Preconditions.checkNotNull(name, "name must not be null");
Preconditions.checkArgument(name.length() < 6, "name must be longer than 6 chars");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment