Package org.passay

Class PasswordData


  • public class PasswordData
    extends Object
    Contains password related information used by rules to perform password validation.
    Author:
    Middleware Services
    • Constructor Detail

      • PasswordData

        public PasswordData()
        Default constructor.
      • PasswordData

        public PasswordData​(String p)
        Creates a new password data. The origin of this data is assumed to be PasswordData.Origin.User by default.
        Parameters:
        p - password
      • PasswordData

        public PasswordData​(String u,
                            String p)
        Creates a new password data. The origin of this data is assumed to be PasswordData.Origin.User by default.
        Parameters:
        u - username
        p - password
      • PasswordData

        public PasswordData​(String p,
                            PasswordData.Origin o)
        Creates a new password data.
        Parameters:
        p - password
        o - origin
      • PasswordData

        public PasswordData​(String u,
                            String p,
                            PasswordData.Origin o)
        Creates a new password data.
        Parameters:
        u - username
        p - password
        o - origin
    • Method Detail

      • setPassword

        public void setPassword​(String p)
        Sets the password.
        Parameters:
        p - password
      • getPassword

        public String getPassword()
        Returns the password.
        Returns:
        password
      • setOrigin

        public void setOrigin​(PasswordData.Origin o)
        Sets the origin.
        Parameters:
        o - origin
      • setUsername

        public void setUsername​(String s)
        Sets the username.
        Parameters:
        s - username
      • getUsername

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

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

        public <T extends PasswordData.ReferenceList<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
      • setPasswordReferences

        public void setPasswordReferences​(PasswordData.Reference... r)
        Sets the password references.
        Parameters:
        r - password references
      • setPasswordReferences

        public void setPasswordReferences​(List<PasswordData.Reference> l)
        Sets the password references.
        Parameters:
        l - password references
      • newPasswordData

        public static PasswordData newPasswordData​(PasswordData data)
        Returns a password data initialized with the supplied data.
        Parameters:
        data - password data to read properties from
        Returns:
        password data