Class BookRoomDTO
java.lang.Object
de.gustavblass.fsu.fmi.roombooking.dto.FilterReservationsDTO
de.gustavblass.fsu.fmi.roombooking.dto.BookRoomDTO
Data-transfer object that represents a new
Reservation that shall be placed.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @Nullable BooleanIf set, indicates whether the user needs an accessible Room.private @Nullable Map<String, IndividualEquipmentMutableDTO> Remembers the return value ofgetIndividualEquipmentMap()until theindividualEquipmentis updated.private @NonNull List<IndividualEquipmentMutableDTO> TheRoom.equipment.private @Nullable Integerprivate @Nullable @NotNull ReservationTypeWhether this DTO represents a regularReservationor aSeatReservation.private @Nullable @NotNull String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable BooleanWarning! Do not use this method! It is meant for the Spring framework only.@NonNull List<IndividualEquipmentMutableDTO> @NonNull @Unmodifiable Map<String, IndividualEquipmentMutableDTO> @Nullable IntegergetSeats()Warning! Do not use this method! It is meant for the Spring framework only.@Nullable ReservationTypegetType()Warning! Do not use this method! It is meant for the Spring framework only.@Nullable StringgetUse()Warning! Do not use this method! It is meant for the Spring framework only.booleanseats()voidsetCommonEquipment(@NonNull Collection<String> commonEquipment) Updates thecommonEquipment.voidsetIndividualEquipment(Collection<IndividualEquipmentMutableDTO> individualEquipment) Updates theindividualEquipment.voidUpdates the intended use.@NonNull Optional<ReservationType> type()Methods inherited from class FilterReservationsDTO
date, from, getDate, getFrom, getRoom, getTo, isEmpty, onlyRoomIsSet, roomNumber, setDate, setFrom, setRoom, setTo, to
-
Field Details
-
use
-
type
Whether this DTO represents a regularReservationor aSeatReservation. -
seats
TheSeatReservation.count. If set, thisBookRoomDTOdoes not necessarily represent aSeatReservation. This seat count must only be taken into account if thetypeisReservationType.SEAT_RESERVATION. Otherwise, this seat count must be ignored. -
individualEquipment
TheRoom.equipment. -
commonEquipment
-
accessibility
If set, indicates whether the user needs an accessible Room. -
cachedIndividualEquipmentMap
Remembers the return value ofgetIndividualEquipmentMap()until theindividualEquipmentis updated.
-
-
Constructor Details
-
BookRoomDTO
public BookRoomDTO()
-
-
Method Details
-
setUse
Updates the intended use.- Parameters:
intendedUse- The new intended use Will not be set if it is blank.
-
getUse
Warning! Do not use this method! It is meant for the Spring framework only.- See Also:
-
getType
Warning! Do not use this method! It is meant for the Spring framework only.- See Also:
-
getSeats
Warning! Do not use this method! It is meant for the Spring framework only.- See Also:
-
getAccessibility
Warning! Do not use this method! It is meant for the Spring framework only.- See Also:
-
intendedUse
- Returns:
- The intended use, if specified.
-
type
- Returns:
- The
type, if specified.
-
seats
- Returns:
- The seat count, if specified.
-
accessibility
- Returns:
- Whether the
Roomshall be accessible, if specified.
-
getIndividualEquipment
- Returns:
- The
individualEquipment. - Implementation Note:
- Spring uses the reference of the
individualEquipmentlist to fill in the actual form inputs. To the author's current knowledge, there is no alternative to this violation of good programming practices.
-
getIndividualEquipmentMap
@NonNull public @NonNull @Unmodifiable Map<String, IndividualEquipmentMutableDTO> getIndividualEquipmentMap()- Returns:
- The
individualEquipmentas aMapwhere theIndividualEquipmentMutableDTO.typeserves as the key and the DTO itself as the value. - Implementation Note:
- Returns the
cachedIndividualEquipmentMapif not null.
-
getCommonEquipment
- Returns:
- The
commonEquipment. Empty if no common equipment is defined.
-
hasIndividualEquipment
@Contract(pure=true) public boolean hasIndividualEquipment()- Returns:
- True if there is at least one item in the
individualEquipmentwithIndividualEquipmentMutableDTO.count> 0. False otherwise.
-
setIndividualEquipment
public void setIndividualEquipment(Collection<IndividualEquipmentMutableDTO> individualEquipment) throws de.gustavblass.commons.exceptions.IllegalArgumentException Updates theindividualEquipment.- Parameters:
individualEquipment- The newindividualEquipment. NoIndividualEquipmentTypemust occur more than once.- Throws:
de.gustavblass.commons.exceptions.IllegalArgumentException- If one of the individual-equipment types occurs more than once.- Implementation Note:
- Clears the
cachedIndividualEquipmentMap.
-
setCommonEquipment
public void setCommonEquipment(@NonNull @NonNull Collection<String> commonEquipment) throws de.gustavblass.commons.exceptions.IllegalArgumentException Updates thecommonEquipment.- Parameters:
commonEquipment- The new common equipment. NoCommonEquipmentTypemust occur more than once.- Throws:
de.gustavblass.commons.exceptions.IllegalArgumentException- If one of the common-equipment types occurs more than once.
-