Record Class Payment
java.lang.Object
java.lang.Record
be.appify.prefab.example.sale.Payment
public record Payment(@NotNull BigDecimal amount, @NotNull PaymentMethod method, Reference<GiftVoucher> giftVoucher)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionPayment(@NotNull BigDecimal amount, @NotNull PaymentMethod method, Reference<GiftVoucher> giftVoucher) Creates an instance of aPaymentrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull BigDecimalamount()Returns the value of theamountrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegiftVoucherrecord component.final inthashCode()Returns a hash code value for this object.@NotNull PaymentMethodmethod()Returns the value of themethodrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Payment
public Payment(@NotNull @NotNull BigDecimal amount, @NotNull @NotNull PaymentMethod method, Reference<GiftVoucher> giftVoucher) Creates an instance of aPaymentrecord class.- Parameters:
amount- the value for theamountrecord componentmethod- the value for themethodrecord componentgiftVoucher- the value for thegiftVoucherrecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
amount
Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
giftVoucher
Returns the value of thegiftVoucherrecord component.- Returns:
- the value of the
giftVoucherrecord component
-