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 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 Integerpage()Returns the value of thepagerecord component.@NonNull IntegerpageSize()Returns the value of thepageSizerecord component.@NonNull StringReturns the value of theproductNamerecord component.@NonNull StringReturns the value of thesortFieldrecord component.@NonNull StringReturns the value of thesortOrderrecord component.final StringtoString()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 aFridgeItemSearchDTOrecord class.- Parameters:
fridgeId- the value for thefridgeIdrecord componentproductName- the value for theproductNamerecord componentsortField- the value for thesortFieldrecord componentsortOrder- the value for thesortOrderrecord componentpage- the value for thepagerecord componentpageSize- the value for thepageSizerecord 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 thefridgeIdrecord component.- Returns:
- the value of the
fridgeIdrecord component
-
productName
Returns the value of theproductNamerecord component.- Returns:
- the value of the
productNamerecord component
-
sortField
Returns the value of thesortFieldrecord component.- Returns:
- the value of the
sortFieldrecord component
-
sortOrder
Returns the value of thesortOrderrecord component.- Returns:
- the value of the
sortOrderrecord component
-
page
Returns the value of thepagerecord component.- Returns:
- the value of the
pagerecord component
-
pageSize
Returns the value of thepageSizerecord component.- Returns:
- the value of the
pageSizerecord component
-