Record Class Customer
java.lang.Object
java.lang.Record
be.appify.prefab.example.sale.Customer
public record Customer(String id, long version, @NotNull PersonName name, @NotNull Address address, @NotNull String email)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionCustomer(@NotNull PersonName name, @NotNull Address address, @NotNull String email) Customer(String id, long version, @NotNull PersonName name, @NotNull Address address, @NotNull String email) Creates an instance of aCustomerrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Addressaddress()Returns the value of theaddressrecord component.@NotNull Stringemail()Returns the value of theemailrecord 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.@NotNull PersonNamename()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.longversion()Returns the value of theversionrecord component.
-
Constructor Details
-
Customer
public Customer(@NotNull @NotNull PersonName name, @NotNull @NotNull Address address, @NotNull @NotNull String email) -
Customer
public Customer(String id, long version, @NotNull @NotNull PersonName name, @NotNull @NotNull Address address, @NotNull @NotNull String email) Creates an instance of aCustomerrecord class.- Parameters:
id- the value for theidrecord componentversion- the value for theversionrecord componentname- the value for thenamerecord componentaddress- the value for theaddressrecord componentemail- the value for theemailrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
version
@Version public long version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
address
Returns the value of theaddressrecord component.- Returns:
- the value of the
addressrecord component
-
email
Returns the value of theemailrecord component.- Returns:
- the value of the
emailrecord component
-