Record Class PlaceOrderResult
java.lang.Object
java.lang.Record
com.dmasone.identity.orders.application.PlaceOrderResult
Result of the placement use case. It distinguishes a newly created order
from an idempotent replay so the REST layer can return precise HTTP
semantics without leaking transport concepts into the domain aggregate.
-
Constructor Summary
ConstructorsConstructorDescriptionPlaceOrderResult(OrderResponse order, boolean replayed) Creates an instance of aPlaceOrderResultrecord 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.order()Returns the value of theorderrecord component.static PlaceOrderResultplaced(CustomerOrder order) booleanreplayed()Returns the value of thereplayedrecord component.static PlaceOrderResultreplayed(CustomerOrder order) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PlaceOrderResult
Creates an instance of aPlaceOrderResultrecord class.- Parameters:
order- the value for theorderrecord componentreplayed- the value for thereplayedrecord component
-
-
Method Details
-
placed
-
replayed
-
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 '=='. -
order
Returns the value of theorderrecord component.- Returns:
- the value of the
orderrecord component
-
replayed
public boolean replayed()Returns the value of thereplayedrecord component.- Returns:
- the value of the
replayedrecord component
-