Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.identitymanagement.model;
 

Contains information about the account password policy.

This data type is used as a response element in the GetAccountPasswordPolicy action.

 
 public class PasswordPolicy implements SerializableCloneable {

    
Minimum length to require for IAM user passwords.

Constraints:
Range: 6 - 128

 
     private Integer minimumPasswordLength;

    
Specifies whether to require symbols for IAM user passwords.
 
     private Boolean requireSymbols;

    
Specifies whether to require numbers for IAM user passwords.
 
     private Boolean requireNumbers;

    
Specifies whether to require uppercase characters for IAM user passwords.
 
     private Boolean requireUppercaseCharacters;

    
Specifies whether to require lowercase characters for IAM user passwords.
 
     private Boolean requireLowercaseCharacters;

    
Specifies whether IAM users are allowed to change their own password.
 
     private Boolean allowUsersToChangePassword;

    
Specifies whether IAM users are required to change their password after a specified number of days.
 
     private Boolean expirePasswords;

    
The number of days that an IAM user password is valid.

Constraints:
Range: 1 - 1095

 
     private Integer maxPasswordAge;

    
Specifies the number of previous passwords that IAM users are prevented from reusing.

Constraints:
Range: 1 - 24

 
     private Integer passwordReusePrevention;

    
Specifies whether IAM users are prevented from setting a new password after their password has expired.
 
     private Boolean hardExpiry;

    
Minimum length to require for IAM user passwords.

Constraints:
Range: 6 - 128

Returns:
Minimum length to require for IAM user passwords.
    public Integer getMinimumPasswordLength() {
        return ;
    }
    
    
Minimum length to require for IAM user passwords.

Constraints:
Range: 6 - 128

Parameters:
minimumPasswordLength Minimum length to require for IAM user passwords.
    public void setMinimumPasswordLength(Integer minimumPasswordLength) {
        this. = minimumPasswordLength;
    }
    
    
Minimum length to require for IAM user passwords.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Range: 6 - 128

Parameters:
minimumPasswordLength Minimum length to require for IAM user passwords.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PasswordPolicy withMinimumPasswordLength(Integer minimumPasswordLength) {
        this. = minimumPasswordLength;
        return this;
    }

    
Specifies whether to require symbols for IAM user passwords.

Returns:
Specifies whether to require symbols for IAM user passwords.
    public Boolean isRequireSymbols() {
        return ;
    }
    
    
Specifies whether to require symbols for IAM user passwords.

Parameters:
requireSymbols Specifies whether to require symbols for IAM user passwords.
    public void setRequireSymbols(Boolean requireSymbols) {
        this. = requireSymbols;
    }
    
    
Specifies whether to require symbols for IAM user passwords.

Returns a reference to this object so that method calls can be chained together.

Parameters:
requireSymbols Specifies whether to require symbols for IAM user passwords.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PasswordPolicy withRequireSymbols(Boolean requireSymbols) {
        this. = requireSymbols;
        return this;
    }

    
Specifies whether to require symbols for IAM user passwords.

Returns:
Specifies whether to require symbols for IAM user passwords.
    public Boolean getRequireSymbols() {
        return ;
    }

    
Specifies whether to require numbers for IAM user passwords.

Returns:
Specifies whether to require numbers for IAM user passwords.
    public Boolean isRequireNumbers() {
        return ;
    }
    
    
Specifies whether to require numbers for IAM user passwords.

Parameters:
requireNumbers Specifies whether to require numbers for IAM user passwords.
    public void setRequireNumbers(Boolean requireNumbers) {
        this. = requireNumbers;
    }
    
    
Specifies whether to require numbers for IAM user passwords.

Returns a reference to this object so that method calls can be chained together.

Parameters:
requireNumbers Specifies whether to require numbers for IAM user passwords.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PasswordPolicy withRequireNumbers(Boolean requireNumbers) {
        this. = requireNumbers;
        return this;
    }

    
Specifies whether to require numbers for IAM user passwords.

Returns:
Specifies whether to require numbers for IAM user passwords.
    public Boolean getRequireNumbers() {
        return ;
    }

    
Specifies whether to require uppercase characters for IAM user passwords.

Returns:
Specifies whether to require uppercase characters for IAM user passwords.
        return ;
    }
    
    
Specifies whether to require uppercase characters for IAM user passwords.

Parameters:
requireUppercaseCharacters Specifies whether to require uppercase characters for IAM user passwords.
    public void setRequireUppercaseCharacters(Boolean requireUppercaseCharacters) {
        this. = requireUppercaseCharacters;
    }
    
    
Specifies whether to require uppercase characters for IAM user passwords.

Returns a reference to this object so that method calls can be chained together.

Parameters:
requireUppercaseCharacters Specifies whether to require uppercase characters for IAM user passwords.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PasswordPolicy withRequireUppercaseCharacters(Boolean requireUppercaseCharacters) {
        this. = requireUppercaseCharacters;
        return this;
    }

    
Specifies whether to require uppercase characters for IAM user passwords.

Returns:
Specifies whether to require uppercase characters for IAM user passwords.
        return ;
    }

    
Specifies whether to require lowercase characters for IAM user passwords.

Returns:
Specifies whether to require lowercase characters for IAM user passwords.
        return ;
    }
    
    
Specifies whether to require lowercase characters for IAM user passwords.

Parameters:
requireLowercaseCharacters Specifies whether to require lowercase characters for IAM user passwords.
    public void setRequireLowercaseCharacters(Boolean requireLowercaseCharacters) {
        this. = requireLowercaseCharacters;
    }
    
    
Specifies whether to require lowercase characters for IAM user passwords.

Returns a reference to this object so that method calls can be chained together.

Parameters:
requireLowercaseCharacters Specifies whether to require lowercase characters for IAM user passwords.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PasswordPolicy withRequireLowercaseCharacters(Boolean requireLowercaseCharacters) {
        this. = requireLowercaseCharacters;
        return this;
    }

    
Specifies whether to require lowercase characters for IAM user passwords.

Returns:
Specifies whether to require lowercase characters for IAM user passwords.
        return ;
    }

    
Specifies whether IAM users are allowed to change their own password.

Returns:
Specifies whether IAM users are allowed to change their own password.
        return ;
    }
    
    
Specifies whether IAM users are allowed to change their own password.

Parameters:
allowUsersToChangePassword Specifies whether IAM users are allowed to change their own password.
    public void setAllowUsersToChangePassword(Boolean allowUsersToChangePassword) {
        this. = allowUsersToChangePassword;
    }
    
    
Specifies whether IAM users are allowed to change their own password.

Returns a reference to this object so that method calls can be chained together.

Parameters:
allowUsersToChangePassword Specifies whether IAM users are allowed to change their own password.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PasswordPolicy withAllowUsersToChangePassword(Boolean allowUsersToChangePassword) {
        this. = allowUsersToChangePassword;
        return this;
    }

    
Specifies whether IAM users are allowed to change their own password.

Returns:
Specifies whether IAM users are allowed to change their own password.
        return ;
    }

    
Specifies whether IAM users are required to change their password after a specified number of days.

Returns:
Specifies whether IAM users are required to change their password after a specified number of days.
    public Boolean isExpirePasswords() {
        return ;
    }
    
    
Specifies whether IAM users are required to change their password after a specified number of days.

Parameters:
expirePasswords Specifies whether IAM users are required to change their password after a specified number of days.
    public void setExpirePasswords(Boolean expirePasswords) {
        this. = expirePasswords;
    }
    
    
Specifies whether IAM users are required to change their password after a specified number of days.

Returns a reference to this object so that method calls can be chained together.

Parameters:
expirePasswords Specifies whether IAM users are required to change their password after a specified number of days.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PasswordPolicy withExpirePasswords(Boolean expirePasswords) {
        this. = expirePasswords;
        return this;
    }

    
Specifies whether IAM users are required to change their password after a specified number of days.

Returns:
Specifies whether IAM users are required to change their password after a specified number of days.
    public Boolean getExpirePasswords() {
        return ;
    }

    
The number of days that an IAM user password is valid.

Constraints:
Range: 1 - 1095

Returns:
The number of days that an IAM user password is valid.
    public Integer getMaxPasswordAge() {
        return ;
    }
    
    
The number of days that an IAM user password is valid.

Constraints:
Range: 1 - 1095

Parameters:
maxPasswordAge The number of days that an IAM user password is valid.
    public void setMaxPasswordAge(Integer maxPasswordAge) {
        this. = maxPasswordAge;
    }
    
    
The number of days that an IAM user password is valid.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Range: 1 - 1095

Parameters:
maxPasswordAge The number of days that an IAM user password is valid.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PasswordPolicy withMaxPasswordAge(Integer maxPasswordAge) {
        this. = maxPasswordAge;
        return this;
    }

    
Specifies the number of previous passwords that IAM users are prevented from reusing.

Constraints:
Range: 1 - 24

Returns:
Specifies the number of previous passwords that IAM users are prevented from reusing.
        return ;
    }
    
    
Specifies the number of previous passwords that IAM users are prevented from reusing.

Constraints:
Range: 1 - 24

Parameters:
passwordReusePrevention Specifies the number of previous passwords that IAM users are prevented from reusing.
    public void setPasswordReusePrevention(Integer passwordReusePrevention) {
        this. = passwordReusePrevention;
    }
    
    
Specifies the number of previous passwords that IAM users are prevented from reusing.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Range: 1 - 24

Parameters:
passwordReusePrevention Specifies the number of previous passwords that IAM users are prevented from reusing.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PasswordPolicy withPasswordReusePrevention(Integer passwordReusePrevention) {
        this. = passwordReusePrevention;
        return this;
    }

    
Specifies whether IAM users are prevented from setting a new password after their password has expired.

Returns:
Specifies whether IAM users are prevented from setting a new password after their password has expired.
    public Boolean isHardExpiry() {
        return ;
    }
    
    
Specifies whether IAM users are prevented from setting a new password after their password has expired.

Parameters:
hardExpiry Specifies whether IAM users are prevented from setting a new password after their password has expired.
    public void setHardExpiry(Boolean hardExpiry) {
        this. = hardExpiry;
    }
    
    
Specifies whether IAM users are prevented from setting a new password after their password has expired.

Returns a reference to this object so that method calls can be chained together.

Parameters:
hardExpiry Specifies whether IAM users are prevented from setting a new password after their password has expired.
Returns:
A reference to this updated object so that method calls can be chained together.
    public PasswordPolicy withHardExpiry(Boolean hardExpiry) {
        this. = hardExpiry;
        return this;
    }

    
Specifies whether IAM users are prevented from setting a new password after their password has expired.

Returns:
Specifies whether IAM users are prevented from setting a new password after their password has expired.
    public Boolean getHardExpiry() {
        return ;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getMinimumPasswordLength() != nullsb.append("MinimumPasswordLength: " + getMinimumPasswordLength() + ",");
        if (isRequireSymbols() != nullsb.append("RequireSymbols: " + isRequireSymbols() + ",");
        if (isRequireNumbers() != nullsb.append("RequireNumbers: " + isRequireNumbers() + ",");
        if (isRequireUppercaseCharacters() != nullsb.append("RequireUppercaseCharacters: " + isRequireUppercaseCharacters() + ",");
        if (isRequireLowercaseCharacters() != nullsb.append("RequireLowercaseCharacters: " + isRequireLowercaseCharacters() + ",");
        if (isAllowUsersToChangePassword() != nullsb.append("AllowUsersToChangePassword: " + isAllowUsersToChangePassword() + ",");
        if (isExpirePasswords() != nullsb.append("ExpirePasswords: " + isExpirePasswords() + ",");
        if (getMaxPasswordAge() != nullsb.append("MaxPasswordAge: " + getMaxPasswordAge() + ",");
        if (getPasswordReusePrevention() != nullsb.append("PasswordReusePrevention: " + getPasswordReusePrevention() + ",");
        if (isHardExpiry() != nullsb.append("HardExpiry: " + isHardExpiry() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getMinimumPasswordLength() == null) ? 0 : getMinimumPasswordLength().hashCode()); 
        hashCode = prime * hashCode + ((isRequireSymbols() == null) ? 0 : isRequireSymbols().hashCode()); 
        hashCode = prime * hashCode + ((isRequireNumbers() == null) ? 0 : isRequireNumbers().hashCode()); 
        hashCode = prime * hashCode + ((isRequireUppercaseCharacters() == null) ? 0 : isRequireUppercaseCharacters().hashCode()); 
        hashCode = prime * hashCode + ((isRequireLowercaseCharacters() == null) ? 0 : isRequireLowercaseCharacters().hashCode()); 
        hashCode = prime * hashCode + ((isAllowUsersToChangePassword() == null) ? 0 : isAllowUsersToChangePassword().hashCode()); 
        hashCode = prime * hashCode + ((isExpirePasswords() == null) ? 0 : isExpirePasswords().hashCode()); 
        hashCode = prime * hashCode + ((getMaxPasswordAge() == null) ? 0 : getMaxPasswordAge().hashCode()); 
        hashCode = prime * hashCode + ((getPasswordReusePrevention() == null) ? 0 : getPasswordReusePrevention().hashCode()); 
        hashCode = prime * hashCode + ((isHardExpiry() == null) ? 0 : isHardExpiry().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof PasswordPolicy == falsereturn false;
        PasswordPolicy other = (PasswordPolicy)obj;
        
        if (other.getMinimumPasswordLength() == null ^ this.getMinimumPasswordLength() == nullreturn false;
        if (other.getMinimumPasswordLength() != null && other.getMinimumPasswordLength().equals(this.getMinimumPasswordLength()) == falsereturn false
        if (other.isRequireSymbols() == null ^ this.isRequireSymbols() == nullreturn false;
        if (other.isRequireSymbols() != null && other.isRequireSymbols().equals(this.isRequireSymbols()) == falsereturn false
        if (other.isRequireNumbers() == null ^ this.isRequireNumbers() == nullreturn false;
        if (other.isRequireNumbers() != null && other.isRequireNumbers().equals(this.isRequireNumbers()) == falsereturn false
        if (other.isRequireUppercaseCharacters() == null ^ this.isRequireUppercaseCharacters() == nullreturn false;
        if (other.isRequireUppercaseCharacters() != null && other.isRequireUppercaseCharacters().equals(this.isRequireUppercaseCharacters()) == falsereturn false
        if (other.isRequireLowercaseCharacters() == null ^ this.isRequireLowercaseCharacters() == nullreturn false;
        if (other.isRequireLowercaseCharacters() != null && other.isRequireLowercaseCharacters().equals(this.isRequireLowercaseCharacters()) == falsereturn false
        if (other.isAllowUsersToChangePassword() == null ^ this.isAllowUsersToChangePassword() == nullreturn false;
        if (other.isAllowUsersToChangePassword() != null && other.isAllowUsersToChangePassword().equals(this.isAllowUsersToChangePassword()) == falsereturn false
        if (other.isExpirePasswords() == null ^ this.isExpirePasswords() == nullreturn false;
        if (other.isExpirePasswords() != null && other.isExpirePasswords().equals(this.isExpirePasswords()) == falsereturn false
        if (other.getMaxPasswordAge() == null ^ this.getMaxPasswordAge() == nullreturn false;
        if (other.getMaxPasswordAge() != null && other.getMaxPasswordAge().equals(this.getMaxPasswordAge()) == falsereturn false
        if (other.getPasswordReusePrevention() == null ^ this.getPasswordReusePrevention() == nullreturn false;
        if (other.getPasswordReusePrevention() != null && other.getPasswordReusePrevention().equals(this.getPasswordReusePrevention()) == falsereturn false
        if (other.isHardExpiry() == null ^ this.isHardExpiry() == nullreturn false;
        if (other.isHardExpiry() != null && other.isHardExpiry().equals(this.isHardExpiry()) == falsereturn false
        return true;
    }
    
    @Override
    public PasswordPolicy clone() {
        try {
            return (PasswordPolicysuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X