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 boolean
Indicates whether some other object is "equal to" this one.@NonNull Long
fridgeId()
Returns the value of thefridgeId
record component.final int
hashCode()
Returns a hash code value for this object.@NonNull String
itemName()
Returns the value of theitemName
record component.@NonNull Long
statId()
Returns the value of thestatId
record component.@NonNull Long
Returns the value of thestatTypeId
record component.@NonNull Double
Returns the value of thestatValue
record component.@NonNull String
Returns the value of thestoreName
record component.@NonNull Date
Returns the value of thetimestamp
record component.final String
toString()
Returns a string representation of this record class.@NonNull Long
userId()
Returns the value of theuserId
record 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 aStatDTO
record class.- Parameters:
statId
- the value for thestatId
record componentstatValue
- the value for thestatValue
record componenttimestamp
- the value for thetimestamp
record componentfridgeId
- the value for thefridgeId
record componentstatTypeId
- the value for thestatTypeId
record componentuserId
- the value for theuserId
record componentitemName
- the value for theitemName
record componentstoreName
- the value for thestoreName
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
statId
Returns the value of thestatId
record component.- Returns:
- the value of the
statId
record component
-
statValue
Returns the value of thestatValue
record component.- Returns:
- the value of the
statValue
record component
-
timestamp
Returns the value of thetimestamp
record component.- Returns:
- the value of the
timestamp
record component
-
fridgeId
Returns the value of thefridgeId
record component.- Returns:
- the value of the
fridgeId
record component
-
statTypeId
Returns the value of thestatTypeId
record component.- Returns:
- the value of the
statTypeId
record component
-
userId
Returns the value of theuserId
record component.- Returns:
- the value of the
userId
record component
-
itemName
Returns the value of theitemName
record component.- Returns:
- the value of the
itemName
record component
-
storeName
Returns the value of thestoreName
record component.- Returns:
- the value of the
storeName
record component
-