Record Class FridgeMemberLoadDTO
java.lang.Object
java.lang.Record
edu.ntnu.idatt2106_2023_06.backend.dto.fridge.FridgeMemberLoadDTO
- Record Components:
username
- Username of the user, given as a StringfirstName
- First name of the user, given as a StringlastName
- Last name of the user, given as a Stringemail
- Email of the user, given as a StringisSuperUser
- Status of whether user is superuser or not.
public record FridgeMemberLoadDTO(long userId, @NonNull String username, @NonNull String firstName, @NonNull String lastName, @NonNull String email, @NonNull Boolean isSuperUser)
extends Record
A data transfer object representing a user's basic information, used for loading user data.
- Author:
- Brage Halvorsen Kvamme, Trym Hamer Gudvangen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull String
email()
Returns the value of theemail
record component.final boolean
Indicates whether some other object is "equal to" this one.@NonNull String
Returns the value of thefirstName
record component.final int
hashCode()
Returns a hash code value for this object.@NonNull Boolean
Returns the value of theisSuperUser
record component.@NonNull String
lastName()
Returns the value of thelastName
record component.final String
toString()
Returns a string representation of this record class.long
userId()
Returns the value of theuserId
record component.@NonNull String
username()
Returns the value of theusername
record component.
-
Constructor Details
-
FridgeMemberLoadDTO
public FridgeMemberLoadDTO(@Nullable long userId, @NonNull @NonNull String username, @NonNull @NonNull String firstName, @NonNull @NonNull String lastName, @NonNull @NonNull String email, @NonNull @NonNull Boolean isSuperUser) Creates an instance of aFridgeMemberLoadDTO
record class.- Parameters:
userId
- the value for theuserId
record componentusername
- the value for theusername
record componentfirstName
- the value for thefirstName
record componentlastName
- the value for thelastName
record componentemail
- the value for theemail
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 '=='. -
userId
@Nullable public long userId()Returns the value of theuserId
record component.- Returns:
- the value of the
userId
record component
-
username
Returns the value of theusername
record component.- Returns:
- the value of the
username
record component
-
firstName
Returns the value of thefirstName
record component.- Returns:
- the value of the
firstName
record component
-
lastName
Returns the value of thelastName
record component.- Returns:
- the value of the
lastName
record component
-
email
Returns the value of theemail
record component.- Returns:
- the value of the
email
record component
-
isSuperUser
Returns the value of theisSuperUser
record component.- Returns:
- the value of the
isSuperUser
record component
-