Record Class FridgeUserDTO
java.lang.Object
java.lang.Record
edu.ntnu.idatt2106_2023_06.backend.dto.fridge.FridgeUserDTO
- Record Components:
fridgeId
- ID of the fridge, given as a Long object.username
- Username of the user, given as a StringisSuperUser
- Status of whether user is superusertrue
or notfalse
public record FridgeUserDTO(@NonNull Long fridgeId, @NonNull String username, @lombok.NonNull boolean isSuperUser)
extends Record
A DTO class representing the relationship between a user and a fridge.
It contains information about the fridge id, the username of the user, and if the user is a superuser or not.
- Author:
- Trym Hamer Gudvangen
-
Constructor Summary
ConstructorsConstructorDescriptionFridgeUserDTO
(@NonNull Long fridgeId, @NonNull String username, @lombok.NonNull boolean isSuperUser) Creates an instance of aFridgeUserDTO
record class. -
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.@lombok.NonNull boolean
Returns the value of theisSuperUser
record component.final String
toString()
Returns a string representation of this record class.@NonNull String
username()
Returns the value of theusername
record component.
-
Constructor Details
-
FridgeUserDTO
public FridgeUserDTO(@NonNull @NonNull Long fridgeId, @NonNull @NonNull String username, @NonNull @lombok.NonNull boolean isSuperUser) Creates an instance of aFridgeUserDTO
record class.- Parameters:
fridgeId
- the value for thefridgeId
record componentusername
- the value for theusername
record componentisSuperUser
- the value for theisSuperUser
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
fridgeId
Returns the value of thefridgeId
record component.- Returns:
- the value of the
fridgeId
record component
-
username
Returns the value of theusername
record component.- Returns:
- the value of the
username
record component
-
isSuperUser
@NonNull public @lombok.NonNull boolean isSuperUser()Returns the value of theisSuperUser
record component.- Returns:
- the value of the
isSuperUser
record component
-