Record Class Invoice
java.lang.Object
java.lang.Record
be.appify.prefab.example.sale.invoice.Invoice
public record Invoice(String id, long version, BigDecimal total, Instant created, String invoiceNumber)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionInvoice(String id, long version, BigDecimal total, Instant created, String invoiceNumber) Creates an instance of aInvoicerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncreated()Returns the value of thecreatedrecord 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.Returns the value of theinvoiceNumberrecord component.final StringtoString()Returns a string representation of this record class.total()Returns the value of thetotalrecord component.longversion()Returns the value of theversionrecord component.
-
Constructor Details
-
Invoice
Creates an instance of aInvoicerecord class.- Parameters:
id- the value for theidrecord componentversion- the value for theversionrecord componenttotal- the value for thetotalrecord componentcreated- the value for thecreatedrecord componentinvoiceNumber- the value for theinvoiceNumberrecord component
-
-
Method Details
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
version
public long version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
total
Returns the value of thetotalrecord component.- Returns:
- the value of the
totalrecord component
-
created
Returns the value of thecreatedrecord component.- Returns:
- the value of the
createdrecord component
-
invoiceNumber
Returns the value of theinvoiceNumberrecord component.- Returns:
- the value of the
invoiceNumberrecord component
-