Class PasswordField


  • public final class PasswordField
    extends ConfigurationField
    A ConfigurationField that consists of secret information. When prompting the user for fields of this type, the user interface should obscure the users entry. In addition, when fields of this type are serialized, the user's entry is encrypted.
    See Also:
    ConfigurationField
    • Constructor Detail

      • PasswordField

        public PasswordField​(String fieldName,
                             String fieldValue)
                      throws IllegalArgumentException
        Create a new password field with the specified password value
        Parameters:
        fieldName - the unique identifier for this field
        fieldValue - the clear text password
        Throws:
        IllegalArgumentException - if fieldName is null or empty or if fieldValue is null (fieldValue may be empty though)
      • PasswordField

        public PasswordField​(String fieldName,
                             Password fieldValue)
                      throws IllegalArgumentException
        Create a new password field
        Parameters:
        fieldName - the unique identifier for this field
        fieldValue - the clear text password
        Throws:
        IllegalArgumentException - if fieldName is null or empty or if fieldValue is null (fieldValue may be empty though)
    • Method Detail

      • getFieldValue

        public Password getFieldValue()
        Returns the password.
        Returns:
        the password.
      • withValue

        public PasswordField withValue​(Password fieldValue)
                                throws IllegalArgumentException
        Creates a new field, equivalent to this, but with the value set to the specified value.
        Parameters:
        fieldValue - the new value
        Returns:
        a new field with its settings modified
        Throws:
        IllegalArgumentException - if value is null (may be empty though)
      • withValue

        public PasswordField withValue​(String fieldValue)
        Creates a new field, equivalent to this, but with the value set to the specified value.
        Parameters:
        fieldValue - the new value
        Returns:
        a new field with its settings modified
        Throws:
        IllegalArgumentException - if value is null (may be empty though)