Record Class UserDto
java.lang.Object
java.lang.Record
com.app.controller.dto.user.UserDto
- Record Components:
id
- the unique identifier of the username
- the user's given namesurname
- the user's surnameusername
- the user's login usernameemail
- the user's email addressage
- the user's ageholidaysHours
- the number of holiday hours the user has accruedrole
- the role assigned to the user (e.g., admin, worker)
public record UserDto(Long id, String name, String surname, String username, String email, Integer age, Long holidaysHours, Role role)
extends Record
Data Transfer Object (DTO) representing user details.
Typically used to transfer user information between layers or to the client.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionage()
Returns the value of theage
record component.email()
Returns the value of theemail
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theholidaysHours
record component.id()
Returns the value of theid
record component.name()
Returns the value of thename
record component.role()
Returns the value of therole
record component.surname()
Returns the value of thesurname
record component.final String
toString()
Returns a string representation of this record class.username()
Returns the value of theusername
record component.
-
Constructor Details
-
UserDto
public UserDto(Long id, String name, String surname, String username, String email, Integer age, Long holidaysHours, Role role) Creates an instance of aUserDto
record class.- Parameters:
id
- the value for theid
record componentname
- the value for thename
record componentsurname
- the value for thesurname
record componentusername
- the value for theusername
record componentemail
- the value for theemail
record componentage
- the value for theage
record componentholidaysHours
- the value for theholidaysHours
record componentrole
- the value for therole
record 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)
. -
id
-
name
-
surname
-
username
-
email
-
age
-
holidaysHours
Returns the value of theholidaysHours
record component.- Returns:
- the value of the
holidaysHours
record component
-
role
-