Record Class ResetPasswordRequest

java.lang.Object
java.lang.Record
org.ntnu.idi.idatt2106.sparesti.sparestibackend.dto.user.ResetPasswordRequest
Record Components:
resetID - ID of reset password entry
userID - User ID
newPassword - new password
All Implemented Interfaces:
Serializable

public record ResetPasswordRequest(@NotNull(message="Reset ID cannot be null") @NotBlank(message="Reset ID cannot be blank") String resetID, @NotNull(message="User ID cannot be null") Long userID, @NotNull(message="New password cannot be null") @NotBlank(message="New password cannot be blank") String newPassword) extends Record implements Serializable
DTO for resetting password
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    ResetPasswordRequest(@NotNull(message="Reset ID cannot be null") @NotBlank(message="Reset ID cannot be blank") String resetID, @NotNull(message="User ID cannot be null") Long userID, @NotNull(message="New password cannot be null") @NotBlank(message="New password cannot be blank") String newPassword)
    Creates an instance of a ResetPasswordRequest record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull(message="New password cannot be null") @NotBlank(message="New password cannot be blank") String
    Returns the value of the newPassword record component.
    @NotNull(message="Reset ID cannot be null") @NotBlank(message="Reset ID cannot be blank") String
    Returns the value of the resetID record component.
    final String
    Returns a string representation of this record class.
    @NotNull(message="User ID cannot be null") Long
    Returns the value of the userID record component.

    Methods inherited from class java.lang.Object

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

    • ResetPasswordRequest

      public ResetPasswordRequest(@NotNull(message="Reset ID cannot be null") @NotBlank(message="Reset ID cannot be blank") @NotNull(message="Reset ID cannot be null") @NotBlank(message="Reset ID cannot be blank") String resetID, @NotNull(message="User ID cannot be null") @NotNull(message="User ID cannot be null") Long userID, @NotNull(message="New password cannot be null") @NotBlank(message="New password cannot be blank") @NotNull(message="New password cannot be null") @NotBlank(message="New password cannot be blank") String newPassword)
      Creates an instance of a ResetPasswordRequest record class.
      Parameters:
      resetID - the value for the resetID record component
      userID - the value for the userID record component
      newPassword - the value for the newPassword record component
  • Method Details

    • toString

      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

      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

      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.
    • resetID

      @NotNull(message="Reset ID cannot be null") @NotBlank(message="Reset ID cannot be blank") public @NotNull(message="Reset ID cannot be null") @NotBlank(message="Reset ID cannot be blank") String resetID()
      Returns the value of the resetID record component.
      Returns:
      the value of the resetID record component
    • userID

      @NotNull(message="User ID cannot be null") public @NotNull(message="User ID cannot be null") Long userID()
      Returns the value of the userID record component.
      Returns:
      the value of the userID record component
    • newPassword

      @NotNull(message="New password cannot be null") @NotBlank(message="New password cannot be blank") public @NotNull(message="New password cannot be null") @NotBlank(message="New password cannot be blank") String newPassword()
      Returns the value of the newPassword record component.
      Returns:
      the value of the newPassword record component