Record Class UserSpecificationDto
java.lang.Object
java.lang.Record
com.app.controller.dto.user.UserSpecificationDto
- Record Components:
name
- the user's given name to filter by (optional)surname
- the user's surname to filter by (optional)username
- the user's username to filter by (optional)email
- the user's email to filter by (optional)minAge
- the minimum age to filter by (optional)maxAge
- the maximum age to filter by (optional)minHolidayHours
- the minimum holiday hours to filter by (optional)maxHolidayHours
- the maximum holiday hours to filter by (optional)
public record UserSpecificationDto(String name, String surname, String username, String email, Integer minAge, Integer maxAge, Long minHolidayHours, Long maxHolidayHours)
extends Record
Data Transfer Object (DTO) for filtering and querying users based on various criteria.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionemail()
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.maxAge()
Returns the value of themaxAge
record component.Returns the value of themaxHolidayHours
record component.minAge()
Returns the value of theminAge
record component.Returns the value of theminHolidayHours
record component.name()
Returns the value of thename
record component.surname()
Returns the value of thesurname
record component.final String
toString()
Returns a string representation of this record class.Converts this DTO to aUserSpecification
used for querying the database.username()
Returns the value of theusername
record component.
-
Constructor Details
-
UserSpecificationDto
public UserSpecificationDto(String name, String surname, String username, String email, Integer minAge, Integer maxAge, Long minHolidayHours, Long maxHolidayHours) Creates an instance of aUserSpecificationDto
record class.- Parameters:
name
- the value for thename
record componentsurname
- the value for thesurname
record componentusername
- the value for theusername
record componentemail
- the value for theemail
record componentminAge
- the value for theminAge
record componentmaxAge
- the value for themaxAge
record componentminHolidayHours
- the value for theminHolidayHours
record componentmaxHolidayHours
- the value for themaxHolidayHours
record component
-
-
Method Details
-
toUserSpecification
Converts this DTO to aUserSpecification
used for querying the database.- Returns:
- a new instance of
UserSpecification
initialized with the criteria from this DTO
-
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)
. -
name
-
surname
-
username
-
email
-
minAge
-
maxAge
-
minHolidayHours
Returns the value of theminHolidayHours
record component.- Returns:
- the value of the
minHolidayHours
record component
-
maxHolidayHours
Returns the value of themaxHolidayHours
record component.- Returns:
- the value of the
maxHolidayHours
record component
-