Record Class ItemLoadDTO
java.lang.Object
java.lang.Record
edu.ntnu.idatt2106_2023_06.backend.dto.items.ItemLoadDTO
- Record Components:
itemId- The ID of the item.name- The name of the product.description- The description of the product.store- The name of the store the item comes from.price- The price of the item.image- The link to the image of the item.quantity- The amount present of the item.suggestion- Whether the item is a suggestion or not.
public record ItemLoadDTO(@NonNull Long itemId, @NonNull String name, String description, @NonNull String store, double price, String image, int quantity, Boolean suggestion)
extends Record
This record represents a DTO for loading an item.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.image()Returns the value of theimagerecord component.@NonNull LongitemId()Returns the value of theitemIdrecord component.@NonNull Stringname()Returns the value of thenamerecord component.doubleprice()Returns the value of thepricerecord component.intquantity()Returns the value of thequantityrecord component.@NonNull Stringstore()Returns the value of thestorerecord component.Returns the value of thesuggestionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ItemLoadDTO
public ItemLoadDTO(@NonNull @NonNull Long itemId, @NonNull @NonNull String name, String description, @NonNull @NonNull String store, double price, String image, int quantity, Boolean suggestion) Creates an instance of aItemLoadDTOrecord class.- Parameters:
itemId- the value for theitemIdrecord componentname- the value for thenamerecord componentdescription- the value for thedescriptionrecord componentstore- the value for thestorerecord componentprice- the value for thepricerecord componentimage- the value for theimagerecord componentquantity- the value for thequantityrecord componentsuggestion- the value for thesuggestionrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
itemId
Returns the value of theitemIdrecord component.- Returns:
- the value of the
itemIdrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
store
Returns the value of thestorerecord component.- Returns:
- the value of the
storerecord component
-
price
public double price()Returns the value of thepricerecord component.- Returns:
- the value of the
pricerecord component
-
image
Returns the value of theimagerecord component.- Returns:
- the value of the
imagerecord component
-
quantity
public int quantity()Returns the value of thequantityrecord component.- Returns:
- the value of the
quantityrecord component
-
suggestion
Returns the value of thesuggestionrecord component.- Returns:
- the value of the
suggestionrecord component
-