Record Class RoomSummaryDTO

java.lang.Object
java.lang.Record
de.gustavblass.fsu.fmi.roombooking.dto.RoomSummaryDTO
Record Components:
number - The Room.number.
type - Represents the extending Room class.
floor - The Room.floor.
capacity - The Room.capacity.

public record RoomSummaryDTO(@NonNull String number, @NonNull RoomType type, int floor, int capacity) extends Record
Data-transfer object that represents a summary of a Room with the type() field indicating the extending class.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The field for the capacity record component.
    private final int
    The field for the floor record component.
    private final @NonNull String
    The field for the number record component.
    private final @NonNull RoomType
    The field for the type record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RoomSummaryDTO(@NonNull String number, @NonNull RoomType type, int floor, int capacity)
    Creates an instance of a RoomSummaryDTO record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the capacity record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the floor record component.
    final int
    Returns a hash code value for this object.
    @NonNull String
    Returns the value of the number record component.
    final String
    Returns a string representation of this record class.
    @NonNull RoomType
    Returns the value of the type record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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.
  • Constructor Details

    • RoomSummaryDTO

      public RoomSummaryDTO(@NonNull @NonNull String number, @NonNull @NonNull RoomType type, int floor, int capacity)
      Creates an instance of a RoomSummaryDTO 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
  • 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