Record Class ChangePassword

java.lang.Object
java.lang.Record
com.easydesk.modules.records.ChangePassword
Record Components:
username - (참고용 - 실제 대상 사용자는 세션의 로그인 사용자로 확정하고 이 값은 신뢰하지 않는다)
oldPassword - 현재 비밀번호
password - 새 비밀번호
repassword - 새 비밀번호 확인

public record ChangePassword(String username, String oldPassword, String password, String repassword) extends Record
비밀번호 변경 화면에서 쓰는 폼 바인딩용 레코드. UserManager#changePassword(User, String oldPassword, String newPassword) 계약에 맞춰 oldPassword 필드를 추가했다 (기존에는 username/password/repassword만 있어서 "현재 비밀번호 확인" 없이 새 비밀번호만 바꾸는 forcePassword() 용도로밖에 못 썼다). password() = 새 비밀번호, repassword() = 새 비밀번호 확인, oldPassword() = 현재 비밀번호. TODO : validator 자동 설치, AttributeValue 의 Validator 에서 처리
  • Constructor Details

    • ChangePassword

      public ChangePassword(String username, String oldPassword, String password, String repassword)
      Creates an instance of a ChangePassword record class.
      Parameters:
      username - the value for the username record component
      oldPassword - the value for the oldPassword record component
      password - the value for the password record component
      repassword - the value for the repassword 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.
    • username

      public String username()
      Returns the value of the username record component.
      Returns:
      the value of the username record component
    • oldPassword

      public String oldPassword()
      Returns the value of the oldPassword record component.
      Returns:
      the value of the oldPassword record component
    • password

      public String password()
      Returns the value of the password record component.
      Returns:
      the value of the password record component
    • repassword

      public String repassword()
      Returns the value of the repassword record component.
      Returns:
      the value of the repassword record component