Record Class StatDTO

java.lang.Object
java.lang.Record
edu.ntnu.idatt2106_2023_06.backend.dto.stat.StatDTO

public record StatDTO(@NonNull Long statId, @NonNull Double statValue, @NonNull Date timestamp, @NonNull Long fridgeId, @NonNull Long statTypeId, @NonNull Long userId, @NonNull String itemName, @NonNull String storeName) extends Record
This record represents a general statistics DTO.
  • Constructor Summary

    Constructors
    Constructor
    Description
    StatDTO(@NonNull Long statId, @NonNull Double statValue, @NonNull Date timestamp, @NonNull Long fridgeId, @NonNull Long statTypeId, @NonNull Long userId, @NonNull String itemName, @NonNull String storeName)
    Creates an instance of a StatDTO record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    @NonNull Long
    Returns the value of the fridgeId record component.
    final int
    Returns a hash code value for this object.
    @NonNull String
    Returns the value of the itemName record component.
    @NonNull Long
    Returns the value of the statId record component.
    @NonNull Long
    Returns the value of the statTypeId record component.
    @NonNull Double
    Returns the value of the statValue record component.
    @NonNull String
    Returns the value of the storeName record component.
    @NonNull Date
    Returns the value of the timestamp record component.
    final String
    Returns a string representation of this record class.
    @NonNull Long
    Returns the value of the userId record component.

    Methods inherited from class java.lang.Object

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

    • StatDTO

      public StatDTO(@NonNull @NonNull Long statId, @NonNull @NonNull Double statValue, @NonNull @NonNull Date timestamp, @NonNull @NonNull Long fridgeId, @NonNull @NonNull Long statTypeId, @NonNull @NonNull Long userId, @NonNull @NonNull String itemName, @NonNull @NonNull String storeName)
      Creates an instance of a StatDTO record class.
      Parameters:
      statId - the value for the statId record component
      statValue - the value for the statValue record component
      timestamp - the value for the timestamp record component
      fridgeId - the value for the fridgeId record component
      statTypeId - the value for the statTypeId record component
      userId - the value for the userId record component
      itemName - the value for the itemName record component
      storeName - the value for the storeName 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 Objects::equals(Object,Object).
      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.
    • statId

      @NonNull public @NonNull Long statId()
      Returns the value of the statId record component.
      Returns:
      the value of the statId record component
    • statValue

      @NonNull public @NonNull Double statValue()
      Returns the value of the statValue record component.
      Returns:
      the value of the statValue record component
    • timestamp

      @NonNull public @NonNull Date timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • fridgeId

      @NonNull public @NonNull Long fridgeId()
      Returns the value of the fridgeId record component.
      Returns:
      the value of the fridgeId record component
    • statTypeId

      @NonNull public @NonNull Long statTypeId()
      Returns the value of the statTypeId record component.
      Returns:
      the value of the statTypeId record component
    • userId

      @NonNull public @NonNull Long userId()
      Returns the value of the userId record component.
      Returns:
      the value of the userId record component
    • itemName

      @NonNull public @NonNull String itemName()
      Returns the value of the itemName record component.
      Returns:
      the value of the itemName record component
    • storeName

      @NonNull public @NonNull String storeName()
      Returns the value of the storeName record component.
      Returns:
      the value of the storeName record component