Skip to content

Instantly share code, notes, and snippets.

@Kotlin-Native
Created July 10, 2015 07:02
Show Gist options
  • Select an option

  • Save Kotlin-Native/0af1734ce24e7b6a3d91 to your computer and use it in GitHub Desktop.

Select an option

Save Kotlin-Native/0af1734ce24e7b6a3d91 to your computer and use it in GitHub Desktop.
public class Address {
public static Builder newAddress() {
return new Address().new Builder();
}
private String street;
...
public class Builder {
public Builder ofStreet(String initialStreet) {
street = validateStreet(initialStreet);
return this;
}
public Address build() {
validate();
return Address.this;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment