Record Class UserSpecification
java.lang.Object
java.lang.Record
com.app.persistence.specification.model.UserSpecification
- Record Components:
name
- the name of the user to filter by (exact match, optional)surname
- the surname of the user to filter by (exact match, optional)username
- the username to filter by (exact match, optional)email
- the email to filter by (exact match, optional)minAge
- the minimum age of the user (inclusive, optional)maxAge
- the maximum age of the user (inclusive, optional)minHolidayHours
- the minimum amount of holiday hours (inclusive, optional)maxHolidayHours
- the maximum amount of holiday hours (inclusive, optional)
public record UserSpecification(String name, String surname, String username, String email, Integer minAge, Integer maxAge, Long minHolidayHours, Long maxHolidayHours)
extends Record
Specification model used to filter
UserEntity
entities based on dynamic criteria.
This record is intended to be used in conjunction with Specification<UserEntity>
to build type-safe, flexible queries in a declarative way.
-
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.username()
Returns the value of theusername
record component.
-
Constructor Details
-
UserSpecification
public UserSpecification(String name, String surname, String username, String email, Integer minAge, Integer maxAge, Long minHolidayHours, Long maxHolidayHours) Creates an instance of aUserSpecification
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
-
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
-