Package no.priv.bang.ukelonn.beans
Record Class User
java.lang.Object
java.lang.Record
no.priv.bang.ukelonn.beans.User
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for theemailrecord component.private final StringThe field for thefirstnamerecord component.private final StringThe field for thelastnamerecord component.private final intThe field for theuserIdrecord component.private final StringThe field for theusernamerecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionemail()Returns the value of theemailrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstnamerecord component.fullname()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.intuserId()Returns the value of theuserIdrecord component.username()Returns the value of theusernamerecord component.static User.Builderwith()static User.Builder
-
Field Details
-
userId
private final int userIdThe field for theuserIdrecord component. -
username
The field for theusernamerecord component. -
email
The field for theemailrecord component. -
firstname
The field for thefirstnamerecord component. -
lastname
The field for thelastnamerecord component.
-
-
Constructor Details
-
User
Creates an instance of aUserrecord class.- Parameters:
userId- the value for theuserIdrecord componentusername- the value for theusernamerecord componentemail- the value for theemailrecord componentfirstname- the value for thefirstnamerecord componentlastname- the value for thelastnamerecord component
-
-
Method Details
-
fullname
-
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 '=='. -
userId
public int userId()Returns the value of theuserIdrecord component.- Returns:
- the value of the
userIdrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
email
Returns the value of theemailrecord component.- Returns:
- the value of the
emailrecord 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
-