Skip to content

Instantly share code, notes, and snippets.

@yusufcakal
Created October 3, 2017 17:40
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 yusufcakal/850b0280f7ad9e1e44533c244bf6d6b9 to your computer and use it in GitHub Desktop.
Save yusufcakal/850b0280f7ad9e1e44533c244bf6d6b9 to your computer and use it in GitHub Desktop.
Mudium Oost
package pojo;
/**
* @author Yusuf
* @since 02.10.2017
*/
public class Company {
private String name, phone, address;
public Company(Builder builder) {
this.name = builder.name;
this.phone = builder.phone;
this.address = builder.address;
}
public String getName() {
return name;
}
public String getPhone() {
return phone;
}
public String getAddress() {
return address;
}
public static class Builder{
private String name, phone, address;
/**
* @param name Company Name - (Required Field)
*/
public Builder(String name){
this.name = name;
}
/**
* @param phone Company Phone - (Optional Field)
*/
public Builder setPhone(String phone){
this.phone = phone;
return this;
}
/**
* @param address Company Address - (Optional Field)
*/
public Builder setAddress(String address){
this.address = address;
return this;
}
public Company build(){
return new Company(this);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment