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 aRegisterRequestrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull(message="Email cannot be null") @Email(message="Ugylig mail") Stringemail()Returns the value of theemailrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull(message="First name cannot be null") @NotBlank(message="First name cannot be blank") StringReturns the value of thefirstNamerecord component.final inthashCode()Returns a hash code value for this object.@NotNull(message="Last name cannot be null") @NotBlank(message="Last name cannot be blank") StringlastName()Returns the value of thelastNamerecord component.@NotNull(message="Password cannot be null") @NotBlank(message="Password cannot be blank") Stringpassword()Returns the value of thepasswordrecord component.final StringtoString()Returns a string representation of this record class.@NotNull(message="Username cannot be null") @NotBlank(message="Username cannot be blank") Stringusername()Returns the value of theusernamerecord 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 aRegisterRequestrecord 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 thefirstNamerecord component.- Returns:
- the value of the
firstNamerecord 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 thelastNamerecord component.- Returns:
- the value of the
lastNamerecord 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 theusernamerecord component.- Returns:
- the value of the
usernamerecord 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 thepasswordrecord component.- Returns:
- the value of the
passwordrecord 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 theemailrecord component.- Returns:
- the value of the
emailrecord component
-