Record Class UserResponse
java.lang.Object
java.lang.Record
org.ntnu.idi.idatt2106.sparesti.sparestibackend.dto.user.UserResponse
- Record Components:
id- Id of userfirstName- First namelastName- Last nameusername- usernameemail- EmailspendingAccount- Spending accountsavingAccount- saving accountsavedAmount- Saved moneybadges- User badgeshasPasskey- Boolean for whether user has biometric login
- All Implemented Interfaces:
Serializable
public record UserResponse(Long id, @NotNull String firstName, @NotNull String lastName, @NotNull String username, @NotNull @Email String email, @NotNull AccountDTO spendingAccount, @NotNull AccountDTO savingAccount, @NotNull BigDecimal savedAmount, @NotNull Set<BadgeDTO> badges, @NotNull Boolean hasPasskey)
extends Record
implements Serializable
DTO for
User- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUserResponse(Long id, @NotNull String firstName, @NotNull String lastName, @NotNull String username, @NotNull @Email String email, @NotNull AccountDTO spendingAccount, @NotNull AccountDTO savingAccount, @NotNull BigDecimal savedAmount, @NotNull Set<BadgeDTO> badges, @NotNull Boolean hasPasskey) Creates an instance of aUserResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionbadges()Returns the value of thebadgesrecord component.@NotNull @Email Stringemail()Returns the value of theemailrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull StringReturns the value of thefirstNamerecord component.final inthashCode()Returns a hash code value for this object.@NotNull BooleanReturns the value of thehasPasskeyrecord component.id()Returns the value of theidrecord component.@NotNull StringlastName()Returns the value of thelastNamerecord component.@NotNull BigDecimalReturns the value of thesavedAmountrecord component.@NotNull AccountDTOReturns the value of thesavingAccountrecord component.@NotNull AccountDTOReturns the value of thespendingAccountrecord component.final StringtoString()Returns a string representation of this record class.@NotNull Stringusername()Returns the value of theusernamerecord component.
-
Constructor Details
-
UserResponse
public UserResponse(Long id, @NotNull @NotNull String firstName, @NotNull @NotNull String lastName, @NotNull @NotNull String username, @NotNull @Email @NotNull @Email String email, @NotNull @NotNull AccountDTO spendingAccount, @NotNull @NotNull AccountDTO savingAccount, @NotNull @NotNull BigDecimal savedAmount, @NotNull @NotNull Set<BadgeDTO> badges, @NotNull @NotNull Boolean hasPasskey) Creates an instance of aUserResponserecord class.- Parameters:
id- the value for theidrecord componentfirstName- the value for thefirstNamerecord componentlastName- the value for thelastNamerecord componentusername- the value for theusernamerecord componentemail- the value for theemailrecord componentspendingAccount- the value for thespendingAccountrecord componentsavingAccount- the value for thesavingAccountrecord componentsavedAmount- the value for thesavedAmountrecord componentbadges- the value for thebadgesrecord componenthasPasskey- the value for thehasPasskeyrecord 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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
firstName
Returns the value of thefirstNamerecord component.- Returns:
- the value of the
firstNamerecord component
-
lastName
Returns the value of thelastNamerecord component.- Returns:
- the value of the
lastNamerecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
email
Returns the value of theemailrecord component.- Returns:
- the value of the
emailrecord component
-
spendingAccount
Returns the value of thespendingAccountrecord component.- Returns:
- the value of the
spendingAccountrecord component
-
savingAccount
Returns the value of thesavingAccountrecord component.- Returns:
- the value of the
savingAccountrecord component
-
savedAmount
Returns the value of thesavedAmountrecord component.- Returns:
- the value of the
savedAmountrecord component
-
badges
Returns the value of thebadgesrecord component.- Returns:
- the value of the
badgesrecord component
-
hasPasskey
Returns the value of thehasPasskeyrecord component.- Returns:
- the value of the
hasPasskeyrecord component
-