Package org.passay

Class PasswordData

java.lang.Object
org.passay.PasswordData

public class PasswordData extends Object
Contains password related information used by rules to perform password validation.
  • Field Details

    • password

      private final UnicodeString password
      Stores the password.
    • username

      private final UnicodeString username
      Stores the username.
    • passwordReferences

      private final List<Reference> passwordReferences
      Password references.
    • origin

      private final Origin origin
      Origin of this password.
  • Constructor Details

    • PasswordData

      public PasswordData(CharSequence password)
      Creates a new password data. The origin of this data is Origin.User by default.
      Parameters:
      password - password
    • PasswordData

      public PasswordData(UnicodeString password)
      Creates a new password data. The origin of this data is Origin.User by default.
      Parameters:
      password - password
    • PasswordData

      public PasswordData(CharSequence username, CharSequence password)
      Creates a new password data. The origin of this data is Origin.User by default.
      Parameters:
      username - username
      password - password
    • PasswordData

      public PasswordData(UnicodeString username, UnicodeString password)
      Creates a new password data. The origin of this data is Origin.User by default.
      Parameters:
      username - username
      password - password
    • PasswordData

      public PasswordData(CharSequence password, Origin origin)
      Creates a new password data.
      Parameters:
      password - password
      origin - origin
    • PasswordData

      public PasswordData(UnicodeString password, Origin origin)
      Creates a new password data.
      Parameters:
      password - password
      origin - origin
    • PasswordData

      public PasswordData(CharSequence username, CharSequence password, Origin origin)
      Creates a new password data.
      Parameters:
      username - username
      password - password
      origin - origin
    • PasswordData

      public PasswordData(UnicodeString username, UnicodeString password, Origin origin)
      Creates a new password data.
      Parameters:
      username - username
      password - password
      origin - origin
    • PasswordData

      public PasswordData(CharSequence username, CharSequence password, Reference... references)
      Creates a new password data.
      Parameters:
      username - username
      password - password
      references - references
    • PasswordData

      public PasswordData(UnicodeString username, UnicodeString password, Reference... references)
      Creates a new password data.
      Parameters:
      username - username
      password - password
      references - references
    • PasswordData

      public PasswordData(CharSequence username, CharSequence password, List<Reference> references)
      Creates a new password data.
      Parameters:
      username - username
      password - password
      references - references
    • PasswordData

      public PasswordData(UnicodeString username, UnicodeString password, List<Reference> references)
      Creates a new password data.
      Parameters:
      username - username
      password - password
      references - references
    • PasswordData

      public PasswordData(CharSequence username, CharSequence password, Origin origin, Reference... references)
      Creates a new password data.
      Parameters:
      username - username
      password - password
      origin - origin
      references - references
    • PasswordData

      public PasswordData(UnicodeString username, UnicodeString password, Origin origin, Reference... references)
      Creates a new password data.
      Parameters:
      username - username
      password - password
      origin - origin
      references - references
    • PasswordData

      public PasswordData(CharSequence username, CharSequence password, Origin origin, List<Reference> references)
      Creates a new password data.
      Parameters:
      username - username
      password - password
      origin - origin
      references - references
    • PasswordData

      public PasswordData(UnicodeString username, UnicodeString password, Origin origin, List<Reference> references)
      Creates a new password data.
      Parameters:
      username - username
      password - password
      origin - origin
      references - references
  • Method Details

    • getPassword

      public UnicodeString getPassword()
      Returns the password.
      Returns:
      password
    • getOrigin

      public Origin getOrigin()
      Returns the origin.
      Returns:
      origin
    • getUsername

      public UnicodeString getUsername()
      Returns the username.
      Returns:
      username
    • getPasswordReferences

      public List<Reference> getPasswordReferences()
      Returns the password references.
      Returns:
      password references
    • getPasswordReferences

      public <T extends Reference> List<T> getPasswordReferences(Class<T> type)
      Returns the password references that match the supplied reference type.
      Type Parameters:
      T - type of password reference
      Parameters:
      type - of reference to match
      Returns:
      unmodifiable list of password references
    • clear

      public void clear()
      Clears the memory of the underlying objects in this password data. See UnicodeString.clear().
    • copy

      public static PasswordData copy(PasswordData data)
      Returns a new password data initialized with the supplied data.
      Parameters:
      data - password data to read properties from
      Returns:
      new password data
    • toString

      public String toString()
      Overrides:
      toString in class Object