1 package de.trion.microservices.takeorder;
3 import javax.validation.constraints.NotNull;
7 * Simple DTO used by the REST interface
11 @NotNull(message = "Cannot be null")
13 @NotNull(message = "Cannot be null")
14 private long customerId;
15 @NotNull(message = "Cannot be null")
16 private long productId;
17 @NotNull(message = "Cannot be null")
25 final long customerId,
30 this.customerId = customerId;
31 this.productId = productId;
32 this.quantity = quantity;
40 public long getCustomerId()
45 public long getProductId()
50 public int getQuantity()
57 public boolean equals(final Object o) {
60 if (o == null || this.getClass() != o.getClass())
63 final OrderBean orderBean = (OrderBean) o;
65 return this.customerId == orderBean.customerId;
69 public String toString()
73 ", customerId=" + customerId +
74 ", productId=" + productId +
75 ", quantity=" + quantity +
82 return Long.hashCode(this.id);