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 -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@NonNull LongfridgeId()Returns the value of thefridgeIdrecord component.final inthashCode()Returns a hash code value for this object.@NonNull StringitemName()Returns the value of theitemNamerecord component.@NonNull LongstatId()Returns the value of thestatIdrecord component.@NonNull LongReturns the value of thestatTypeIdrecord component.@NonNull DoubleReturns the value of thestatValuerecord component.@NonNull StringReturns the value of thestoreNamerecord component.@NonNull DateReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.@NonNull LonguserId()Returns the value of theuserIdrecord component.
-
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 aStatDTOrecord class.- Parameters:
statId- the value for thestatIdrecord componentstatValue- the value for thestatValuerecord componenttimestamp- the value for thetimestamprecord componentfridgeId- the value for thefridgeIdrecord componentstatTypeId- the value for thestatTypeIdrecord componentuserId- the value for theuserIdrecord componentitemName- the value for theitemNamerecord componentstoreName- the value for thestoreNamerecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
statId
Returns the value of thestatIdrecord component.- Returns:
- the value of the
statIdrecord component
-
statValue
Returns the value of thestatValuerecord component.- Returns:
- the value of the
statValuerecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
fridgeId
Returns the value of thefridgeIdrecord component.- Returns:
- the value of the
fridgeIdrecord component
-
statTypeId
Returns the value of thestatTypeIdrecord component.- Returns:
- the value of the
statTypeIdrecord component
-
userId
Returns the value of theuserIdrecord component.- Returns:
- the value of the
userIdrecord component
-
itemName
Returns the value of theitemNamerecord component.- Returns:
- the value of the
itemNamerecord component
-
storeName
Returns the value of thestoreNamerecord component.- Returns:
- the value of the
storeNamerecord component
-