Record Class PaymentSummary
java.lang.Object
java.lang.Record
com.example.orderplatform.payments.api.PaymentSummary
- Record Components:
id- payment identifierorderId- order associated with the paymentstatus- current payment statusamount- expected or authorized payment amountcreatedAt- creation timestamp- authorization timestamp, ornullwhile pending
public record PaymentSummary(UUID id, UUID orderId, String status, Money amount, OffsetDateTime createdAt, OffsetDateTime authorizedAt)
extends Record
Immutable payment view exposed by the payment module API.
-
Constructor Summary
ConstructorsConstructorDescriptionPaymentSummary(UUID id, UUID orderId, String status, Money amount, OffsetDateTime createdAt, OffsetDateTime authorizedAt) Creates an instance of aPaymentSummaryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionamount()Returns the value of theamountrecord component.Returns the value of theauthorizedAtrecord component.Returns the value of thecreatedAtrecord 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.orderId()Returns the value of theorderIdrecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PaymentSummary
public PaymentSummary(UUID id, UUID orderId, String status, Money amount, OffsetDateTime createdAt, OffsetDateTime authorizedAt) Creates an instance of aPaymentSummaryrecord class.- Parameters:
id- the value for theidrecord componentorderId- the value for theorderIdrecord componentstatus- the value for thestatusrecord componentamount- the value for theamountrecord componentcreatedAt- the value for thecreatedAtrecord componentauthorizedAt- the value for theauthorizedAtrecord 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
-
orderId
Returns the value of theorderIdrecord component.- Returns:
- the value of the
orderIdrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
amount
Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-
authorizedAt
Returns the value of theauthorizedAtrecord component.- Returns:
- the value of the
authorizedAtrecord component
-