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 boolean
Indicates whether some other object is "equal to" this one.@NonNull String
Returns the value of theexpirationDate
record component.@NonNull Long
fridgeId()
Returns the value of thefridgeId
record component.final int
hashCode()
Returns a hash code value for this object.@NonNull Boolean
isRead()
Returns the value of theisRead
record component.@NonNull String
itemName()
Returns the value of theitemName
record component.@NonNull Long
Returns the value of thenotificationId
record component.final String
toString()
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 aNotificationDTO
record class.- Parameters:
notificationId
- the value for thenotificationId
record componentisRead
- the value for theisRead
record componentitemName
- the value for theitemName
record componentexpirationDate
- the value for theexpirationDate
record componentfridgeId
- the value for thefridgeId
record 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 thenotificationId
record component.- Returns:
- the value of the
notificationId
record component
-
isRead
Returns the value of theisRead
record component.- Returns:
- the value of the
isRead
record component
-
itemName
Returns the value of theitemName
record component.- Returns:
- the value of the
itemName
record component
-
expirationDate
Returns the value of theexpirationDate
record component.- Returns:
- the value of the
expirationDate
record component
-
fridgeId
Returns the value of thefridgeId
record component.- Returns:
- the value of the
fridgeId
record component
-