Record Class RegisterRequest
java.lang.Object
java.lang.Record
org.ntnu.idi.idatt2106.sparesti.sparestibackend.dto.user.RegisterRequest
- Record Components:
firstName
- First namelastName
- last nameusername
- Usernamepassword
- Passwordemail
- Email
- All Implemented Interfaces:
Serializable
public record RegisterRequest(@NotNull(message="First name cannot be null") @NotBlank(message="First name cannot be blank") String firstName, @NotNull(message="Last name cannot be null") @NotBlank(message="Last name cannot be blank") String lastName, @NotNull(message="Username cannot be null") @NotBlank(message="Username cannot be blank") String username, @NotNull(message="Password cannot be null") @NotBlank(message="Password cannot be blank") String password, @NotNull(message="Email cannot be null") @Email(message="Ugylig mail") String email)
extends Record
implements Serializable
DTO used when registering a new user
- Since:
- 17.4.24
- Version:
- 1.0
- Author:
- Harry L.X and Lars M.L.N
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRegisterRequest
(@NotNull(message="First name cannot be null") @NotBlank(message="First name cannot be blank") String firstName, @NotNull(message="Last name cannot be null") @NotBlank(message="Last name cannot be blank") String lastName, @NotNull(message="Username cannot be null") @NotBlank(message="Username cannot be blank") String username, @NotNull(message="Password cannot be null") @NotBlank(message="Password cannot be blank") String password, @NotNull(message="Email cannot be null") @Email(message="Ugylig mail") String email) Creates an instance of aRegisterRequest
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull(message="Email cannot be null") @Email(message="Ugylig mail") String
email()
Returns the value of theemail
record component.final boolean
Indicates whether some other object is "equal to" this one.@NotNull(message="First name cannot be null") @NotBlank(message="First name cannot be blank") String
Returns the value of thefirstName
record component.final int
hashCode()
Returns a hash code value for this object.@NotNull(message="Last name cannot be null") @NotBlank(message="Last name cannot be blank") String
lastName()
Returns the value of thelastName
record component.@NotNull(message="Password cannot be null") @NotBlank(message="Password cannot be blank") String
password()
Returns the value of thepassword
record component.final String
toString()
Returns a string representation of this record class.@NotNull(message="Username cannot be null") @NotBlank(message="Username cannot be blank") String
username()
Returns the value of theusername
record component.
-
Constructor Details
-
RegisterRequest
public RegisterRequest(@NotNull(message="First name cannot be null") @NotBlank(message="First name cannot be blank") @NotNull(message="First name cannot be null") @NotBlank(message="First name cannot be blank") String firstName, @NotNull(message="Last name cannot be null") @NotBlank(message="Last name cannot be blank") @NotNull(message="Last name cannot be null") @NotBlank(message="Last name cannot be blank") String lastName, @NotNull(message="Username cannot be null") @NotBlank(message="Username cannot be blank") @NotNull(message="Username cannot be null") @NotBlank(message="Username cannot be blank") String username, @NotNull(message="Password cannot be null") @NotBlank(message="Password cannot be blank") @NotNull(message="Password cannot be null") @NotBlank(message="Password cannot be blank") String password, @NotNull(message="Email cannot be null") @Email(message="Ugylig mail") @NotNull(message="Email cannot be null") @Email(message="Ugylig mail") String email) Creates an instance of aRegisterRequest
record class.
-
-
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)
. -
firstName
@NotNull(message="First name cannot be null") @NotBlank(message="First name cannot be blank") public @NotNull(message="First name cannot be null") @NotBlank(message="First name cannot be blank") String firstName()Returns the value of thefirstName
record component.- Returns:
- the value of the
firstName
record component
-
lastName
@NotNull(message="Last name cannot be null") @NotBlank(message="Last name cannot be blank") public @NotNull(message="Last name cannot be null") @NotBlank(message="Last name cannot be blank") String lastName()Returns the value of thelastName
record component.- Returns:
- the value of the
lastName
record component
-
username
@NotNull(message="Username cannot be null") @NotBlank(message="Username cannot be blank") public @NotNull(message="Username cannot be null") @NotBlank(message="Username cannot be blank") String username()Returns the value of theusername
record component.- Returns:
- the value of the
username
record component
-
password
@NotNull(message="Password cannot be null") @NotBlank(message="Password cannot be blank") public @NotNull(message="Password cannot be null") @NotBlank(message="Password cannot be blank") String password()Returns the value of thepassword
record component.- Returns:
- the value of the
password
record component
-
email
@NotNull(message="Email cannot be null") @Email(message="Ugylig mail") public @NotNull(message="Email cannot be null") @Email(message="Ugylig mail") String email()Returns the value of theemail
record component.- Returns:
- the value of the
email
record component
-