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 Details

    • UserSpecificationDto

      public UserSpecificationDto(String name, String surname, String username, String email, Integer minAge, Integer maxAge, Long minHolidayHours, Long maxHolidayHours)
      Creates an instance of a UserSpecificationDto record class.
      Parameters:
      name - the value for the name record component
      surname - the value for the surname record component
      username - the value for the username record component
      email - the value for the email record component
      minAge - the value for the minAge record component
      maxAge - the value for the maxAge record component
      minHolidayHours - the value for the minHolidayHours record component
      maxHolidayHours - the value for the maxHolidayHours record component
  • Method Details

    • toUserSpecification

      public UserSpecification toUserSpecification()
      Converts this DTO to a UserSpecification used for querying the database.
      Returns:
      a new instance of UserSpecification initialized with the criteria from this DTO
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • surname

      public String surname()
      Returns the value of the surname record component.
      Returns:
      the value of the surname record component
    • username

      public String username()
      Returns the value of the username record component.
      Returns:
      the value of the username record component
    • email

      public String email()
      Returns the value of the email record component.
      Returns:
      the value of the email record component
    • minAge

      public Integer minAge()
      Returns the value of the minAge record component.
      Returns:
      the value of the minAge record component
    • maxAge

      public Integer maxAge()
      Returns the value of the maxAge record component.
      Returns:
      the value of the maxAge record component
    • minHolidayHours

      public Long minHolidayHours()
      Returns the value of the minHolidayHours record component.
      Returns:
      the value of the minHolidayHours record component
    • maxHolidayHours

      public Long maxHolidayHours()
      Returns the value of the maxHolidayHours record component.
      Returns:
      the value of the maxHolidayHours record component