Created
October 3, 2017 17:40
-
-
Save yusufcakal/850b0280f7ad9e1e44533c244bf6d6b9 to your computer and use it in GitHub Desktop.
Mudium Oost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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