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 superusertrueor 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 aFridgeUserDTOrecord class. -
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.@lombok.NonNull booleanReturns the value of theisSuperUserrecord component.final StringtoString()Returns a string representation of this record class.@NonNull Stringusername()Returns the value of theusernamerecord component.
-
Constructor Details
-
FridgeUserDTO
public FridgeUserDTO(@NonNull @NonNull Long fridgeId, @NonNull @NonNull String username, @NonNull @lombok.NonNull boolean isSuperUser) Creates an instance of aFridgeUserDTOrecord class.- Parameters:
fridgeId- the value for thefridgeIdrecord componentusername- the value for theusernamerecord componentisSuperUser- the value for theisSuperUserrecord 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 thefridgeIdrecord component.- Returns:
- the value of the
fridgeIdrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
isSuperUser
@NonNull public @lombok.NonNull boolean isSuperUser()Returns the value of theisSuperUserrecord component.- Returns:
- the value of the
isSuperUserrecord component
-