Record Class ChangePasswordDTO

java.lang.Object
java.lang.Record
de.gustavblass.fsu.fmi.roombooking.dto.ChangePasswordDTO
Record Components:
currentPassword - The password stored in the database before the change.
newPassword - What the current password shall be replaced with.
repeatedNewPassword - The new password again, in order to confirm the user has not made a typo.

public record ChangePasswordDTO(@NotNull @NotBlank String currentPassword, @NotNull @NotBlank String newPassword, @NotNull @NotBlank String repeatedNewPassword) extends Record
Represents the data necessary to update the Actor.password().
  • Field Details

    • currentPassword

      @NotNull @NotBlank private final @NotNull @NotBlank String currentPassword
      The field for the currentPassword record component.
    • newPassword

      @NotNull @NotBlank private final @NotNull @NotBlank String newPassword
      The field for the newPassword record component.
    • repeatedNewPassword

      @NotNull @NotBlank private final @NotNull @NotBlank String repeatedNewPassword
      The field for the repeatedNewPassword record component.
  • Constructor Details

    • ChangePasswordDTO

      public ChangePasswordDTO(@NotNull @NotBlank @NotNull @NotBlank String currentPassword, @NotNull @NotBlank @NotNull @NotBlank String newPassword, @NotNull @NotBlank @NotNull @NotBlank String repeatedNewPassword)
      Creates an instance of a ChangePasswordDTO record class.
      Parameters:
      currentPassword - the value for the currentPassword record component
      newPassword - the value for the newPassword record component
      repeatedNewPassword - the value for the repeatedNewPassword 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.
    • currentPassword

      @NotNull @NotBlank public @NotNull @NotBlank String currentPassword()
      Returns the value of the currentPassword record component.
      Returns:
      the value of the currentPassword record component
    • newPassword

      @NotNull @NotBlank public @NotNull @NotBlank String newPassword()
      Returns the value of the newPassword record component.
      Returns:
      the value of the newPassword record component
    • repeatedNewPassword

      @NotNull @NotBlank public @NotNull @NotBlank String repeatedNewPassword()
      Returns the value of the repeatedNewPassword record component.
      Returns:
      the value of the repeatedNewPassword record component