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 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 a ItemLoadDTO record class.
      Parameters:
      itemId - the value for the itemId record component
      name - the value for the name record component
      description - the value for the description record component
      store - the value for the store record component
      price - the value for the price record component
      image - the value for the image record component
      quantity - the value for the quantity record component
      suggestion - the value for the suggestion 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 '=='.
      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.
    • itemId

      @NonNull public @NonNull Long itemId()
      Returns the value of the itemId record component.
      Returns:
      the value of the itemId record component
    • name

      @NonNull public @NonNull String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • store

      @NonNull public @NonNull String store()
      Returns the value of the store record component.
      Returns:
      the value of the store record component
    • price

      public double price()
      Returns the value of the price record component.
      Returns:
      the value of the price record component
    • image

      public String image()
      Returns the value of the image record component.
      Returns:
      the value of the image record component
    • quantity

      public int quantity()
      Returns the value of the quantity record component.
      Returns:
      the value of the quantity record component
    • suggestion

      public Boolean suggestion()
      Returns the value of the suggestion record component.
      Returns:
      the value of the suggestion record component