1 package de.trion.microservices.takeorder;
3 import javax.validation.constraints.Min;
4 import javax.validation.constraints.NotNull;
8 * Simple DTO used by the REST interface
10 public class OrderBean
12 @NotNull(message = "Cannot be null")
13 @Min(value = 1, message = "Must be a positive number")
15 @NotNull(message = "Cannot be null")
16 @Min(value = 1, message = "Must be a positive number")
17 private long customerId;
18 @NotNull(message = "Cannot be null")
19 @Min(value = 1, message = "Must be a positive number")
20 private long productId;
21 @NotNull(message = "Cannot be null")
22 @Min(value = 1, message = "Must be a positive number")
30 final long customerId,
35 this.customerId = customerId;
36 this.productId = productId;
37 this.quantity = quantity;
45 public long getCustomerId()
50 public long getProductId()
55 public int getQuantity()
62 public boolean equals(final Object o) {
65 if (o == null || this.getClass() != o.getClass())
68 final OrderBean orderBean = (OrderBean) o;
70 return this.customerId == orderBean.customerId;
74 public String toString()
78 ", customerId=" + customerId +
79 ", productId=" + productId +
80 ", quantity=" + quantity +
87 return Long.hashCode(this.id);