Class FilterReservationsDTO

java.lang.Object
de.gustavblass.fsu.fmi.roombooking.dto.FilterReservationsDTO
Direct Known Subclasses:
BookRoomDTO

public class FilterReservationsDTO extends Object
Data-transfer object that represents the filtering parameters when viewing as an administrator.
  • Field Details

    • room

      @Nullable @NotBlank private @Nullable @NotBlank String room
      Only show Reservations for the Room with this room number.
    • date

      @Nullable @NotNull private @Nullable @NotNull LocalDate date
      Only show Reservations for this date. Must be a parseable LocalDate.
    • from

      @Nullable @NotNull private @Nullable @NotNull LocalTime from
      Only show Reservations starting or ending after the given time on the given date. If no date is specified, today is used instead. from must be a parseable LocalTime.
    • to

      @Nullable @NotNull private @Nullable @NotNull LocalTime to
      Only show Reservations starting or ending before the given time on the given date. If no date is specified, today is used instead. to must be a parseable LocalTime.
  • Constructor Details

    • FilterReservationsDTO

      public FilterReservationsDTO()
  • Method Details

    • setRoom

      public void setRoom(@Nullable @Nullable String room)
      Updates the room number.
      Parameters:
      room - The new Room.number. Will not be set if it is blank.
    • setDate

      public void setDate(@Nullable @Nullable LocalDate date)
      Updates the date.
      Parameters:
      date - The new date for which to show Reservations.
    • setFrom

      public void setFrom(@Nullable @Nullable LocalTime startTime)
      Updates the start time.
      Parameters:
      startTime - The new start time after which to show Reservations.
    • setTo

      public void setTo(@Nullable @Nullable LocalTime endTime)
      Updates the end time.
      Parameters:
      endTime - The new end time after which to show Reservations.
    • getRoom

      @Nullable public @Nullable String getRoom()
      Warning! Do not use this method! It is meant for the Spring framework only.
      See Also:
    • getDate

      @Nullable public @Nullable LocalDate getDate()
      Warning! Do not use this method! It is meant for the Spring framework only.
      See Also:
    • getFrom

      @Nullable public @Nullable LocalTime getFrom()
      Warning! Do not use this method! It is meant for the Spring framework only.
      See Also:
    • getTo

      @Nullable public @Nullable LocalTime getTo()
      Warning! Do not use this method! It is meant for the Spring framework only.
      See Also:
    • roomNumber

      @NonNull public @NonNull Optional<String> roomNumber()
      Returns:
      The room number, if specified.
    • date

      @NonNull public @NonNull Optional<LocalDate> date()
      Returns:
      The date, if specified.
    • from

      @NonNull public @NonNull Optional<LocalTime> from()
      Returns:
      The start time, if specified.
    • to

      @NonNull public @NonNull Optional<LocalTime> to()
      Returns:
      The end time, if specified.
    • isEmpty

      public boolean isEmpty()

      Checks whether all fields are null:

      Returns:
      True if all fields are null.
    • onlyRoomIsSet

      public boolean onlyRoomIsSet()

      Checks that the room number is specified but all other fields are null:

      Returns:
      True if all fields but the room number are null.