Record Class RoomDTO

java.lang.Object
java.lang.Record
de.gustavblass.fsu.fmi.roombooking.dto.RoomDTO
Record Components:
number - The Room.number.
type - Represents the extending Room class.
floor - The Room.floor.
capacity - The Room.capacity.
individualEquipment - The Room.getIndividualEquipment().
commonEquipment - The ConferenceRoom.commonEquipment if this Room is a RoomType.CONFERENCE_ROOM.
accessibility - The Room.accessibility.
notes - The Room.notes.

public record RoomDTO(@NonNull String number, @NonNull RoomType type, int floor, int capacity, @NonNull Set<IndividualEquipmentDTO> individualEquipment, @Nullable Set<String> commonEquipment, @Nullable Accessibility accessibility, @Nullable String notes) extends Record
Data-transfer object that represents a Room with the type() field indicating the extending class.
  • Field Details

    • number

      @NonNull private final @NonNull String number
      The field for the number record component.
    • type

      @NonNull private final @NonNull RoomType type
      The field for the type record component.
    • floor

      private final int floor
      The field for the floor record component.
    • capacity

      private final int capacity
      The field for the capacity record component.
    • individualEquipment

      @NonNull private final @NonNull Set<IndividualEquipmentDTO> individualEquipment
      The field for the individualEquipment record component.
    • commonEquipment

      @Nullable private final @Nullable Set<String> commonEquipment
      The field for the commonEquipment record component.
    • accessibility

      @Nullable private final @Nullable Accessibility accessibility
      The field for the accessibility record component.
    • notes

      @Nullable private final @Nullable String notes
      The field for the notes record component.
  • Constructor Details

    • RoomDTO

      public RoomDTO(@NonNull @NonNull String number, @NonNull @NonNull RoomType type, int floor, int capacity, @NonNull @NonNull Set<IndividualEquipmentDTO> individualEquipment, @Nullable @Nullable Set<String> commonEquipment, @Nullable @Nullable Accessibility accessibility, @Nullable @Nullable String notes)
      Creates an instance of a RoomDTO record class.
      Parameters:
      number - the value for the number record component
      type - the value for the type record component
      floor - the value for the floor record component
      capacity - the value for the capacity record component
      individualEquipment - the value for the individualEquipment record component
      commonEquipment - the value for the commonEquipment record component
      accessibility - the value for the accessibility record component
      notes - the value for the notes record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • number

      @NonNull public @NonNull String number()
      Returns the value of the number record component.
      Returns:
      the value of the number record component
    • type

      @NonNull public @NonNull RoomType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • floor

      public int floor()
      Returns the value of the floor record component.
      Returns:
      the value of the floor record component
    • capacity

      public int capacity()
      Returns the value of the capacity record component.
      Returns:
      the value of the capacity record component
    • individualEquipment

      @NonNull public @NonNull Set<IndividualEquipmentDTO> individualEquipment()
      Returns the value of the individualEquipment record component.
      Returns:
      the value of the individualEquipment record component
    • commonEquipment

      @Nullable public @Nullable Set<String> commonEquipment()
      Returns the value of the commonEquipment record component.
      Returns:
      the value of the commonEquipment record component
    • accessibility

      @Nullable public @Nullable Accessibility accessibility()
      Returns the value of the accessibility record component.
      Returns:
      the value of the accessibility record component
    • notes

      @Nullable public @Nullable String notes()
      Returns the value of the notes record component.
      Returns:
      the value of the notes record component