Package no.priv.bang.ukelonn.beans
Record Class Account
java.lang.Object
java.lang.Record
no.priv.bang.ukelonn.beans.Account
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theaccountIdrecord component.private final doubleThe field for thebalancerecord component.private final StringThe field for thefirstNamerecord component.private final StringThe field for thelastNamerecord component.private final StringThe field for theusernamerecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theaccountIdrecord component.doublebalance()Returns the value of thebalancerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstNamerecord component.final inthashCode()Returns a hash code value for this object.lastName()Returns the value of thelastNamerecord component.final StringtoString()Returns a string representation of this record class.username()Returns the value of theusernamerecord component.static Account.Builderwith()static Account.Builder
-
Field Details
-
accountId
private final int accountIdThe field for theaccountIdrecord component. -
username
The field for theusernamerecord component. -
firstName
The field for thefirstNamerecord component. -
lastName
The field for thelastNamerecord component. -
balance
private final double balanceThe field for thebalancerecord component.
-
-
Constructor Details
-
Account
Creates an instance of aAccountrecord class.- Parameters:
accountId- the value for theaccountIdrecord componentusername- the value for theusernamerecord componentfirstName- the value for thefirstNamerecord componentlastName- the value for thelastNamerecord componentbalance- the value for thebalancerecord component
-
-
Method Details
-
getFullName
-
with
-
with
-
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 '=='. -
accountId
public int accountId()Returns the value of theaccountIdrecord component.- Returns:
- the value of the
accountIdrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
firstName
Returns the value of thefirstNamerecord component.- Returns:
- the value of the
firstNamerecord component
-
lastName
Returns the value of thelastNamerecord component.- Returns:
- the value of the
lastNamerecord component
-
balance
public double balance()Returns the value of thebalancerecord component.- Returns:
- the value of the
balancerecord component
-