Record Class PlaceOrderRequest
java.lang.Object
java.lang.Record
com.dmasone.identity.orders.interfaces.rest.PlaceOrderRequest
public record PlaceOrderRequest(@NotNull Long productId, @NotNull @Min(1L) Integer quantity)
extends Record
HTTP request model for order placement. Validation failures are converted by
the application-level REST exception handler into stable error responses.
-
Constructor Summary
ConstructorsConstructorDescriptionPlaceOrderRequest(@NotNull Long productId, @NotNull @Min(1L) Integer quantity) Creates an instance of aPlaceOrderRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull LongReturns the value of theproductIdrecord component.@NotNull @Min(1L) Integerquantity()Returns the value of thequantityrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PlaceOrderRequest
public PlaceOrderRequest(@NotNull @NotNull Long productId, @NotNull @Min(1L) @NotNull @Min(1L) Integer quantity) Creates an instance of aPlaceOrderRequestrecord class.- Parameters:
productId- the value for theproductIdrecord componentquantity- the value for thequantityrecord 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). -
productId
Returns the value of theproductIdrecord component.- Returns:
- the value of the
productIdrecord component
-
quantity
Returns the value of thequantityrecord component.- Returns:
- the value of the
quantityrecord component
-