Class AvailabilityFilters

java.lang.Object
it.univr.passportease.dto.input.AvailabilityFilters
All Implemented Interfaces:
Serializable, org.springframework.data.jpa.domain.Specification<Availability>

public class AvailabilityFilters extends Object implements org.springframework.data.jpa.domain.Specification<Availability>
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Date
    The end date to filter the query by.
    private LocalTime
    The end time to filter the query by.
    private List<String>
    The offices name to filter the query by.
    private List<String>
    The request types to filter the query by.
    private Date
    The start date to filter the query by.
    private LocalTime
    The start time to filter the query by.

    Fields inherited from interface org.springframework.data.jpa.domain.Specification

    serialVersionUID
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private boolean
    Checks if the start date and end date are valid.
    private boolean
    Checks if the start date, end date, start time and end time are valid.
    private boolean
    Checks if the start date and end date are valid.
    private boolean
    Checks if the start date, end date, start time and end time are valid.
    jakarta.persistence.criteria.Predicate
    toPredicate(@NotNull jakarta.persistence.criteria.Root<Availability> root, @NotNull jakarta.persistence.criteria.CriteriaQuery<?> query, @NotNull jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder)
    Creates a Predicate from the AvailabilityFilters object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.data.jpa.domain.Specification

    and, or
  • Field Details

    • officesName

      private List<String> officesName
      The offices name to filter the query by.
    • requestTypes

      private List<String> requestTypes
      The request types to filter the query by.
    • startDate

      private Date startDate
      The start date to filter the query by.
    • endDate

      private Date endDate
      The end date to filter the query by.
    • startTime

      private LocalTime startTime
      The start time to filter the query by.
    • endTime

      private LocalTime endTime
      The end time to filter the query by.
  • Constructor Details

    • AvailabilityFilters

      public AvailabilityFilters()
  • Method Details

    • toPredicate

      public jakarta.persistence.criteria.Predicate toPredicate(@NotNull @NotNull jakarta.persistence.criteria.Root<Availability> root, @NotNull @NotNull jakarta.persistence.criteria.CriteriaQuery<?> query, @NotNull @NotNull jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder)
      Creates a Predicate from the AvailabilityFilters object. The Predicate is used to filter the Availability query.
      Specified by:
      toPredicate in interface org.springframework.data.jpa.domain.Specification<Availability>
      Parameters:
      root - must not be null. The root entity, i.e. Availability
      query - must not be null. The query to modify. Not used in this implementation
      criteriaBuilder - must not be null. Builder used to construct the Predicate
      Returns:
      Predicate to apply to the query.
    • isEndTimeValid

      private boolean isEndTimeValid()
      Checks if the start date, end date, start time and end time are valid.
      Returns:
      True if the end time is valid, that is if the start time is before the end time or the end time is null.
    • isStartTimeValid

      private boolean isStartTimeValid()
      Checks if the start date, end date, start time and end time are valid.
      Returns:
      True if the start time is valid, that is if the end time is after the start time or the start time is null.
    • isEndDateValid

      private boolean isEndDateValid()
      Checks if the start date and end date are valid.
      Returns:
      True if the end date is valid, that is if the start date is before the end date or the end date is null.
    • isStartDateValid

      private boolean isStartDateValid()
      Checks if the start date and end date are valid.
      Returns:
      True if the start date is valid, that is if the end date is after the start date or the start date is null.