package pl.koszela.jan.domain;

import java.util.Objects;

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

  private String productName;
  private int quantity;

  public Order(String productName, int quantity) {
    this.productName = productName;
    this.quantity = quantity;
  }


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

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

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

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

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Order order = (Order) o;
    return Objects.equals(productName, order.productName);
  }

  @Override
  public int hashCode() {
    return Objects.hash(productName, quantity);
  }
}

@@ -144,30 +144,31 @@
 private 
-String
+Product
  product
 Name;%0A  
@@ -155,28 +155,24 @@
 duct product
-Name
 ;%0A  private 
@@ -253,34 +253,80 @@
 .product
-Name = productName
+ = Product.builder()%0A        .item(productName)%0A        .build()
 ;%0A    th
@@ -364,22 +364,23 @@
  public 
-String
+Product
  getProd
@@ -382,20 +382,16 @@
 tProduct
-Name
 () %7B%0A   
@@ -406,28 +406,24 @@
 this.product
-Name
 ;%0A  %7D%0A%0A  pub
@@ -505,19 +505,16 @@
 duct
-Name(String
+(Product
  pro
@@ -541,20 +541,16 @@
 .product
-Name
  = produ
@@ -872,20 +872,16 @@
 (product
-Name
 , order.
@@ -887,20 +887,16 @@
 .product
-Name
 );%0A  %7D%0A%0A
@@ -964,20 +964,16 @@
 (product
-Name
 , quanti
@@ -975,16 +975,175 @@
 uantity)
+;%0A  %7D%0A%0A  @Override%0A  public String toString() %7B%0A    return %22Order%7B%22 +%0A        %22productName='%22 + product + '%5C'' +%0A        %22, quantity=%22 + quantity +%0A        '%7D'
 ;%0A  %7D%0A%7D%0A

Add toString method for debuging purposes