Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1.     public static class Builder {
  2.         private String firstName;
  3.         private String lastName;
  4.         private DateTime birthDate;
  5.         private String address;
  6.         private int zipCode;
  7.         private String city;
  8.         private String state;
  9.         private String zipCode4;
  10.  
  11.         public Builder firstName(String firstName) {
  12.             this.firstName = firstName;
  13.             return this;
  14.         }
  15.  
  16.         public Builder lastName(String lastName) {
  17.             this.lastName = lastName;
  18.             return this;
  19.         }
  20.  
  21.         public Builder birthDate(DateTime birthDate) {
  22.             this.birthDate = birthDate;
  23.             return this;
  24.         }
  25.  
  26.         public Builder address(String address) {
  27.             this.address = address;
  28.             return this;
  29.         }
  30.  
  31.         public Builder zipCode(int zipCode) {
  32.             this.zipCode = zipCode;
  33.             return this;
  34.         }
  35.  
  36.         public Builder city(String city) {
  37.             this.city = city;
  38.             return this;
  39.         }
  40.  
  41.         public Builder state(String state) {
  42.             this.state = state;
  43.             return this;
  44.         }
  45.  
  46.         public Builder zipCode4(String zipCode4) {
  47.             this.zipCode4 = zipCode4;
  48.             return this;
  49.         }
  50.  
  51.         public User build() {
  52.             return new User(this);
  53.         }
  54.     }
  55.  
  56.     private User(Builder builder) {
  57.         this.firstName = builder.firstName;
  58.         this.lastName = builder.lastName;
  59.         this.birthDate = builder.birthDate;
  60.         this.address = builder.address;
  61.         this.zipCode = builder.zipCode;
  62.         this.city = builder.city;
  63.         this.state = builder.state;
  64.         this.zipCode4 = builder.zipCode4;
  65.     }
  66.