title: using enum with pattern builder in java
body: <p>im trying to learn how to use pattern builder. i could get it to work until i tried to use enum.</p>
  
  <p>I tried to change the code couple of times and each time had different error. right now the error is Incompatible types.</p>
  
  <p>Please can you help bringing this code to working state and if you have suggestions to improve the code it would be great.</p>
  
  <p>thanks.</p>
  
  <p>EDIT:
  now it seems to be okay, but how do i use it with the builder inside the main?
  this was the code i used</p>
  
  <p>main:</p>
  
  <pre><code>Person person3 = new Person.PersonBuilder("Julliete", "Kaplan" )
              .status(); // what should i write here to set the status?
  </code></pre>
  
  <p>person class</p>
  
  <pre><code>public class Person
  {
  private final String name;
  private final String lastname;
  private final int age;
  
  //My enum im trying to use
  private Status status;
  public enum Status
  {
      SINGLE ("Single"), MARRIED ("Married"), WIDOWER ("Widower");
  
      private String status;
  
      private Status(String status)
      {
          this.status = status;
      }
  
      public String getStatus()
      {
          return this.status;
      }
  }
  
  //builder
  private Person(PersonBuilder builder) {
      this.name = builder.name;
      this.lastname = builder.lastname;
      this.age = builder.age;
      this.status = builder.status;
  }
  
  //GETTERS
  public String getName() {
      return name;
  }
  
  public String getLastname() {
      return lastname;
  }
  
  public int getAge() {
      return age;
  }
  
  @Override
  public String toString() {
      return "Person : "+this.name+", "+this.lastname+", "+this.age;
  }
  
  //PersonBuilder
  public static class PersonBuilder
  {
      private final String name;
      private final String lastname;
      private int age;
      private Status status;
  
      public PersonBuilder(String name, String lastname) {
          this.name = name;
          this.lastname = lastname;
      }
  
      public PersonBuilder age(int age) {
          this.age = age;
          return this;
      }
  
      public PersonBuilder status(Status status)
      {
          this.status = status;
          return this;
      }
  
      public Person build() {
          Person person =  new Person(this);
          return person;
      }
  
  }
  </code></pre>