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 aUserResponse
record class. -
Method Summary
Modifier and TypeMethodDescriptionbadges()
Returns the value of thebadges
record component.@NotNull @Email String
email()
Returns the value of theemail
record component.final boolean
Indicates whether some other object is "equal to" this one.@NotNull String
Returns the value of thefirstName
record component.final int
hashCode()
Returns a hash code value for this object.@NotNull Boolean
Returns the value of thehasPasskey
record component.id()
Returns the value of theid
record component.@NotNull String
lastName()
Returns the value of thelastName
record component.@NotNull BigDecimal
Returns the value of thesavedAmount
record component.@NotNull AccountDTO
Returns the value of thesavingAccount
record component.@NotNull AccountDTO
Returns the value of thespendingAccount
record component.final String
toString()
Returns a string representation of this record class.@NotNull String
username()
Returns the value of theusername
record 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 aUserResponse
record class.- Parameters:
id
- the value for theid
record componentfirstName
- the value for thefirstName
record componentlastName
- the value for thelastName
record componentusername
- the value for theusername
record componentemail
- the value for theemail
record componentspendingAccount
- the value for thespendingAccount
record componentsavingAccount
- the value for thesavingAccount
record componentsavedAmount
- the value for thesavedAmount
record componentbadges
- the value for thebadges
record componenthasPasskey
- the value for thehasPasskey
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)
. -
id
Returns the value of theid
record component.- Returns:
- the value of the
id
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
-
username
Returns the value of theusername
record component.- Returns:
- the value of the
username
record component
-
email
Returns the value of theemail
record component.- Returns:
- the value of the
email
record component
-
spendingAccount
Returns the value of thespendingAccount
record component.- Returns:
- the value of the
spendingAccount
record component
-
savingAccount
Returns the value of thesavingAccount
record component.- Returns:
- the value of the
savingAccount
record component
-
savedAmount
Returns the value of thesavedAmount
record component.- Returns:
- the value of the
savedAmount
record component
-
badges
Returns the value of thebadges
record component.- Returns:
- the value of the
badges
record component
-
hasPasskey
Returns the value of thehasPasskey
record component.- Returns:
- the value of the
hasPasskey
record component
-