Record Class RecipeAllergenDTO
java.lang.Object
java.lang.Record
edu.ntnu.idatt2106_2023_06.backend.dto.recipe.RecipeAllergenDTO
- Record Components:
displayName
- The name of the allergen.amount
- The status of how much the allergen is present in the recipe.
This record represents a DTO for a recipe allergen.
-
Constructor Summary
ConstructorsConstructorDescriptionRecipeAllergenDTO
(@NonNull String displayName, @NonNull Amount amount) Creates an instance of aRecipeAllergenDTO
record class. -
Method Summary
Modifier and TypeMethodDescription@NonNull Amount
amount()
Returns the value of theamount
record component.@NonNull String
Returns the value of thedisplayName
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
RecipeAllergenDTO
Creates an instance of aRecipeAllergenDTO
record class.- Parameters:
displayName
- the value for thedisplayName
record componentamount
- the value for theamount
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)
. -
displayName
Returns the value of thedisplayName
record component.- Returns:
- the value of the
displayName
record component
-
amount
Returns the value of theamount
record component.- Returns:
- the value of the
amount
record component
-