Package com.order.api01authgateway.dto
Record Class OrderDTO
java.lang.Object
java.lang.Record
com.order.api01authgateway.dto.OrderDTO
public record OrderDTO(UUID id, @NotBlank String customerName, @NotBlank @Email String customerEmail, @NotNull LocalDateTime orderDate, @NotNull OrderStatus status, @NotNull BigDecimal totalAmount, @Valid List<OrderItemDTO> items)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionOrderDTO(UUID id, @NotBlank String customerName, @NotBlank @Email String customerEmail, @NotNull LocalDateTime orderDate, @NotNull OrderStatus status, @NotNull BigDecimal totalAmount, @Valid List<OrderItemDTO> items) Creates an instance of aOrderDTOrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotBlank @Email StringReturns the value of thecustomerEmailrecord component.@NotBlank StringReturns the value of thecustomerNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.@Valid List<OrderItemDTO> items()Returns the value of theitemsrecord component.@NotNull LocalDateTimeReturns the value of theorderDaterecord component.@NotNull OrderStatusstatus()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.@NotNull BigDecimalReturns the value of thetotalAmountrecord component.
-
Constructor Details
-
OrderDTO
public OrderDTO(UUID id, @NotBlank @NotBlank String customerName, @NotBlank @Email @NotBlank @Email String customerEmail, @NotNull @NotNull LocalDateTime orderDate, @NotNull @NotNull OrderStatus status, @NotNull @NotNull BigDecimal totalAmount, @Valid @Valid List<OrderItemDTO> items) Creates an instance of aOrderDTOrecord class.- Parameters:
id- the value for theidrecord componentcustomerName- the value for thecustomerNamerecord componentcustomerEmail- the value for thecustomerEmailrecord componentorderDate- the value for theorderDaterecord componentstatus- the value for thestatusrecord componenttotalAmount- the value for thetotalAmountrecord componentitems- the value for theitemsrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
customerName
Returns the value of thecustomerNamerecord component.- Returns:
- the value of the
customerNamerecord component
-
customerEmail
Returns the value of thecustomerEmailrecord component.- Returns:
- the value of the
customerEmailrecord component
-
orderDate
Returns the value of theorderDaterecord component.- Returns:
- the value of the
orderDaterecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
totalAmount
Returns the value of thetotalAmountrecord component.- Returns:
- the value of the
totalAmountrecord component
-
items
Returns the value of theitemsrecord component.- Returns:
- the value of the
itemsrecord component
-