Record Class RegisterRequest

java.lang.Object
java.lang.Record
org.ntnu.idi.idatt2106.sparesti.sparestibackend.dto.user.RegisterRequest
Record Components:
firstName - First name
lastName - last name
username - Username
password - Password
email - 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 Link icon

    Constructors
    Constructor
    Description
    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)
    Creates an instance of a RegisterRequest record class.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    @NotNull(message="Email cannot be null") @Email(message="Ugylig mail") String
    Returns the value of the email 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 the firstName record component.
    final int
    Returns a hash code value for this object.
    @NotNull(message="Last name cannot be null") @NotBlank(message="Last name cannot be blank") String
    Returns the value of the lastName record component.
    @NotNull(message="Password cannot be null") @NotBlank(message="Password cannot be blank") String
    Returns the value of the password record component.
    final String
    Returns a string representation of this record class.
    @NotNull(message="Username cannot be null") @NotBlank(message="Username cannot be blank") String
    Returns the value of the username record component.

    Methods inherited from class java.lang.Object Link icon

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details Link icon

    • RegisterRequest Link icon

      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 a RegisterRequest record class.
      Parameters:
      firstName - the value for the firstName record component
      lastName - the value for the lastName record component
      username - the value for the username record component
      password - the value for the password record component
      email - the value for the email record component
  • Method Details Link icon

    • toString Link icon

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode Link icon

      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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals Link icon

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • firstName Link icon

      @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 the firstName record component.
      Returns:
      the value of the firstName record component
    • lastName Link icon

      @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 the lastName record component.
      Returns:
      the value of the lastName record component
    • username Link icon

      @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 the username record component.
      Returns:
      the value of the username record component
    • password Link icon

      @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 the password record component.
      Returns:
      the value of the password record component
    • email Link icon

      @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 the email record component.
      Returns:
      the value of the email record component