Record Class NotificationDTO
java.lang.Object
java.lang.Record
edu.ntnu.idatt2106_2023_06.backend.dto.notification.NotificationDTO
- Record Components:
notificationId- The ID of the notificationisRead- Whether the notification has been read or notitemName- The name of the item the notification concernsexpirationDate- The expiration date of the itemfridgeId- The fridge all of this information pertains to
public record NotificationDTO(@NonNull Long notificationId, @NonNull Boolean isRead, @NonNull String itemName, @NonNull String expirationDate, @NonNull Long fridgeId)
extends Record
This record represents a DTO for a notification.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@NonNull StringReturns the value of theexpirationDaterecord component.@NonNull LongfridgeId()Returns the value of thefridgeIdrecord component.final inthashCode()Returns a hash code value for this object.@NonNull BooleanisRead()Returns the value of theisReadrecord component.@NonNull StringitemName()Returns the value of theitemNamerecord component.@NonNull LongReturns the value of thenotificationIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NotificationDTO
public NotificationDTO(@NonNull @NonNull Long notificationId, @NonNull @NonNull Boolean isRead, @NonNull @NonNull String itemName, @NonNull @NonNull String expirationDate, @NonNull @NonNull Long fridgeId) Creates an instance of aNotificationDTOrecord class.- Parameters:
notificationId- the value for thenotificationIdrecord componentisRead- the value for theisReadrecord componentitemName- the value for theitemNamerecord componentexpirationDate- the value for theexpirationDaterecord componentfridgeId- the value for thefridgeIdrecord component
-
-
Method Details
-
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. -
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. -
equals
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. All components in this record class are compared withObjects::equals(Object,Object). -
notificationId
Returns the value of thenotificationIdrecord component.- Returns:
- the value of the
notificationIdrecord component
-
isRead
Returns the value of theisReadrecord component.- Returns:
- the value of the
isReadrecord component
-
itemName
Returns the value of theitemNamerecord component.- Returns:
- the value of the
itemNamerecord component
-
expirationDate
Returns the value of theexpirationDaterecord component.- Returns:
- the value of the
expirationDaterecord component
-
fridgeId
Returns the value of thefridgeIdrecord component.- Returns:
- the value of the
fridgeIdrecord component
-