package pl.koszela.jan.domain;

/**
 * Created on 12.08.2017.
 *
 * @author Jan Koszela
 */
public class Order {

  private String productName;
  private String quantity;

  @java.beans.ConstructorProperties({"productName", "quantity"})
  Order(String productName, String quantity) {
    this.productName = productName;
    this.quantity = quantity;
  }

  public static OrderBuilder builder() {
    return new OrderBuilder();
  }

  public String getProductName() {
    return this.productName;
  }

  public String getQuantity() {
    return this.quantity;
  }

  public void setProductName(String productName) {
    this.productName = productName;
  }

  public void setQuantity(String quantity) {
    this.quantity = quantity;
  }

  public static class OrderBuilder {

    private String productName;
    private String quantity;

    OrderBuilder() {
    }

    public Order.OrderBuilder productName(String productName) {
      this.productName = productName;
      return this;
    }

    public Order.OrderBuilder quantity(String quantity) {
      this.quantity = quantity;
      return this;
    }

    public Order build() {
      return new Order(productName, quantity);
    }

    public String toString() {
      return "pl.koszela.jan.domain.Order.OrderBuilder(productName=" + this.productName
          + ", quantity=" + this.quantity + ")";
    }
  }
}

@@ -25,16 +25,43 @@
 omain;%0A%0A
+import java.util.Objects;%0A%0A
 /**%0A * C
@@ -166,38 +166,35 @@
 Name;%0A  private 
-Str
 in
-g
+t
  quantity;%0A%0A  @j
@@ -195,72 +195,14 @@
 %0A%0A  
-@java.beans.ConstructorProperties(%7B%22productName%22, %22quantity%22%7D)%0A 
+public
  Ord
@@ -224,22 +224,19 @@
 ctName, 
-Str
 in
-g
+t
  quantit
@@ -315,84 +315,8 @@
  %7D%0A%0A
-  public static OrderBuilder builder() %7B%0A    return new OrderBuilder();%0A  %7D%0A
 %0A  p
@@ -386,30 +386,27 @@
 %7D%0A%0A  public 
-Str
 in
-g
+t
  getQuantity
@@ -551,38 +551,35 @@
 oid setQuantity(
-Str
 in
-g
+t
  quantity) %7B%0A   
@@ -616,235 +616,74 @@
 %0A%0A  
-public static class OrderBuilder %7B%0A%0A    private String productName;%0A    private String quantity;%0A%0A    OrderBuilder() %7B%0A    %7D%0A%0A    public Order.OrderBuilder productName(String productName) %7B%0A      this.productName = productName;
+@Override%0A  public boolean equals(Object o) %7B%0A    if (this == o) %7B
 %0A   
@@ -689,35 +689,35 @@
     return t
-his
+rue
 ;%0A    %7D%0A
 %0A    public 
@@ -708,98 +708,58 @@
   %7D%0A
-%0A
     
-public Order.OrderBuilder quantity(String quantity) %7B%0A      this.quantity = quantity;
+if (o == null %7C%7C getClass() != o.getClass()) %7B
 %0A   
@@ -772,20 +772,21 @@
 urn 
-this
+false
 ;%0A    %7D%0A
 %0A   
@@ -785,116 +785,134 @@
   %7D%0A
-%0A
     
-public Order build() %7B%0A      return new Order(productName, quantity
+Order order = (Order) o;%0A    return Objects.equals(productName, order.productName
 );%0A
-  
   %7D%0A%0A  
-  public String toString
+@Override%0A  public int hashCode
 () %7B
@@ -920,146 +920,51 @@
     
- 
- 
 return 
-%22pl.koszela.jan.domain.Order.OrderBuilder(productName=%22 + this.productName%0A          + %22, quantity=%22 + this.quantity + %22)%22;%0A    %7D
+Objects.hash(productName, quantity);
 %0A  %7D

Remove builder pattern