Record Class FridgeItemSearchDTO
java.lang.Object
java.lang.Record
edu.ntnu.idatt2106_2023_06.backend.dto.items.fridge_items.FridgeItemSearchDTO
public record FridgeItemSearchDTO(@NonNull Long fridgeId, @NonNull String productName, @NonNull String sortField, @NonNull String sortOrder, @NonNull Integer page, @NonNull Integer pageSize)
extends Record
Data Transfer Object for searching Fridge items.
This record contains information about the fridgeId, productName to search for,
the field and order to sort the search results, the page and pageSize of the search results.
-
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 Integer
page()
Returns the value of thepage
record component.@NonNull Integer
pageSize()
Returns the value of thepageSize
record component.@NonNull String
Returns the value of theproductName
record component.@NonNull String
Returns the value of thesortField
record component.@NonNull String
Returns the value of thesortOrder
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
FridgeItemSearchDTO
public FridgeItemSearchDTO(@NonNull @NonNull Long fridgeId, @NonNull @NonNull String productName, @NonNull @NonNull String sortField, @NonNull @NonNull String sortOrder, @NonNull @NonNull Integer page, @NonNull @NonNull Integer pageSize) Creates an instance of aFridgeItemSearchDTO
record class.- Parameters:
fridgeId
- the value for thefridgeId
record componentproductName
- the value for theproductName
record componentsortField
- the value for thesortField
record componentsortOrder
- the value for thesortOrder
record componentpage
- the value for thepage
record componentpageSize
- the value for thepageSize
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)
. -
fridgeId
Returns the value of thefridgeId
record component.- Returns:
- the value of the
fridgeId
record component
-
productName
Returns the value of theproductName
record component.- Returns:
- the value of the
productName
record component
-
sortField
Returns the value of thesortField
record component.- Returns:
- the value of the
sortField
record component
-
sortOrder
Returns the value of thesortOrder
record component.- Returns:
- the value of the
sortOrder
record component
-
page
Returns the value of thepage
record component.- Returns:
- the value of the
page
record component
-
pageSize
Returns the value of thepageSize
record component.- Returns:
- the value of the
pageSize
record component
-