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 thedescription
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.image()
Returns the value of theimage
record component.@NonNull Long
itemId()
Returns the value of theitemId
record component.@NonNull String
name()
Returns the value of thename
record component.double
price()
Returns the value of theprice
record component.int
quantity()
Returns the value of thequantity
record component.@NonNull String
store()
Returns the value of thestore
record component.Returns the value of thesuggestion
record component.final String
toString()
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 aItemLoadDTO
record class.- Parameters:
itemId
- the value for theitemId
record componentname
- the value for thename
record componentdescription
- the value for thedescription
record componentstore
- the value for thestore
record componentprice
- the value for theprice
record componentimage
- the value for theimage
record componentquantity
- the value for thequantity
record componentsuggestion
- the value for thesuggestion
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
itemId
Returns the value of theitemId
record component.- Returns:
- the value of the
itemId
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
description
Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-
store
Returns the value of thestore
record component.- Returns:
- the value of the
store
record component
-
price
public double price()Returns the value of theprice
record component.- Returns:
- the value of the
price
record component
-
image
Returns the value of theimage
record component.- Returns:
- the value of the
image
record component
-
quantity
public int quantity()Returns the value of thequantity
record component.- Returns:
- the value of the
quantity
record component
-
suggestion
Returns the value of thesuggestion
record component.- Returns:
- the value of the
suggestion
record component
-