} public class XingUser {
private final int id;
private final String name;
private final String email;
public static class Builder {
private final int id;
private final String name;
private String email = "";
public Builder(int id, String name) {
this.id = id;
this.name = name;
}
public Builder email(String email) {
this.email = email;
return this;
}
public XingUser build() {
return new XingUser(this);
}
}
private XingUser(Builder builder) {
id = builder.id;
name = builder.name;
email = builder.email;
}
} class XingUser(val id: Int,
val name: String,
val email: String = "",
val premium: Boolean = false) XingUser(id = 1,
name = "Cristian")
XingUser(id = 1,
name = "Cristian",
email = "
[email protected]")
XingUser(id = 1,
name = "Cristian",
premium = true) https://github.com/dbacinski/Design-Patterns-In-Kotlin