Record Class OrderPlacedEvent
java.lang.Object
java.lang.Record
com.dmasone.identity.orders.application.events.OrderPlacedEvent
- All Implemented Interfaces:
DomainEvent,Serializable
public record OrderPlacedEvent(UUID eventId, Instant occurredAt, UUID orderId, Long productId, int quantity)
extends Record
implements DomainEvent
Integration event published after the orders module successfully places an
order. Payment listens to this fact instead of being called directly.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOrderPlacedEvent(UUID orderId, Long productId, int quantity) OrderPlacedEvent(UUID eventId, Instant occurredAt, UUID orderId, Long productId, int quantity) Creates an instance of aOrderPlacedEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.eventId()Returns the value of theeventIdrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theoccurredAtrecord component.orderId()Returns the value of theorderIdrecord component.Returns the value of theproductIdrecord component.intquantity()Returns the value of thequantityrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
OrderPlacedEvent
-
OrderPlacedEvent
public OrderPlacedEvent(UUID eventId, Instant occurredAt, UUID orderId, Long productId, int quantity) Creates an instance of aOrderPlacedEventrecord class.- Parameters:
eventId- the value for theeventIdrecord componentoccurredAt- the value for theoccurredAtrecord componentorderId- the value for theorderIdrecord componentproductId- 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
eventId
Returns the value of theeventIdrecord component.- Specified by:
eventIdin interfaceDomainEvent- Returns:
- the value of the
eventIdrecord component
-
occurredAt
Returns the value of theoccurredAtrecord component.- Specified by:
occurredAtin interfaceDomainEvent- Returns:
- the value of the
occurredAtrecord component
-
orderId
Returns the value of theorderIdrecord component.- Returns:
- the value of the
orderIdrecord component
-
productId
Returns the value of theproductIdrecord component.- Returns:
- the value of the
productIdrecord component
-
quantity
public int quantity()Returns the value of thequantityrecord component.- Returns:
- the value of the
quantityrecord component
-