Record Class FridgeProductRequest

java.lang.Object
java.lang.Record
ntnu.idatt2016.v233.SmartMat.dto.request.product.FridgeProductRequest
Record Components:
fridgeProductId - the id of the fridge product
groupId - the id of the group
ean - the ean of the product
amount - the amount of the product
days - the days before expiry date of the product
price - the price of the product

public record FridgeProductRequest(long fridgeProductId, long groupId, long ean, int amount, int days, double price) extends Record
FridgeProductRequest is a record class representing a request to add a product to a fridge.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FridgeProductRequest(long fridgeProductId, long groupId, long ean, int amount, int days, double price)
    Creates an instance of a FridgeProductRequest record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the amount record component.
    int
    Returns the value of the days record component.
    long
    ean()
    Returns the value of the ean record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the value of the fridgeProductId record component.
    long
    Returns the value of the groupId record component.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the price record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FridgeProductRequest

      public FridgeProductRequest(long fridgeProductId, long groupId, long ean, int amount, int days, double price)
      Creates an instance of a FridgeProductRequest record class.
      Parameters:
      fridgeProductId - the value for the fridgeProductId record component
      groupId - the value for the groupId record component
      ean - the value for the ean record component
      amount - the value for the amount record component
      days - the value for the days record component
      price - the value for the price 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. All components in this record class 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.
    • fridgeProductId

      public long fridgeProductId()
      Returns the value of the fridgeProductId record component.
      Returns:
      the value of the fridgeProductId record component
    • groupId

      public long groupId()
      Returns the value of the groupId record component.
      Returns:
      the value of the groupId record component
    • ean

      public long ean()
      Returns the value of the ean record component.
      Returns:
      the value of the ean record component
    • amount

      public int amount()
      Returns the value of the amount record component.
      Returns:
      the value of the amount record component
    • days

      public int days()
      Returns the value of the days record component.
      Returns:
      the value of the days record component
    • price

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