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;
 
 
Container for the parameters to the ChangePassword operation.

Changes the password of the IAM user who is calling this action. The root account password is not affected by this action.

To change the password for a different user, see UpdateLoginProfile. For more information about modifying passwords, see Managing Passwords in the Using IAM guide.

 
 public class ChangePasswordRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The IAM user's current password.

Constraints:
Length: 1 - 128
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

 
     private String oldPassword;

    
The new password. The new password must conform to the AWS account's password policy, if one exists.

Constraints:
Length: 1 - 128
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

 
     private String newPassword;

    
The IAM user's current password.

Constraints:
Length: 1 - 128
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Returns:
The IAM user's current password.
 
     public String getOldPassword() {
         return ;
     }
    
    
The IAM user's current password.

Constraints:
Length: 1 - 128
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Parameters:
oldPassword The IAM user's current password.
 
     public void setOldPassword(String oldPassword) {
         this. = oldPassword;
     }
    
    
The IAM user's current password.

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

Constraints:
Length: 1 - 128
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Parameters:
oldPassword The IAM user's current password.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ChangePasswordRequest withOldPassword(String oldPassword) {
         this. = oldPassword;
         return this;
    }

    
The new password. The new password must conform to the AWS account's password policy, if one exists.

Constraints:
Length: 1 - 128
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Returns:
The new password. The new password must conform to the AWS account's password policy, if one exists.
    public String getNewPassword() {
        return ;
    }
    
    
The new password. The new password must conform to the AWS account's password policy, if one exists.

Constraints:
Length: 1 - 128
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Parameters:
newPassword The new password. The new password must conform to the AWS account's password policy, if one exists.
    public void setNewPassword(String newPassword) {
        this. = newPassword;
    }
    
    
The new password. The new password must conform to the AWS account's password policy, if one exists.

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

Constraints:
Length: 1 - 128
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Parameters:
newPassword The new password. The new password must conform to the AWS account's password policy, if one exists.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ChangePasswordRequest withNewPassword(String newPassword) {
        this. = newPassword;
        return this;
    }

    
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 (getOldPassword() != nullsb.append("OldPassword: " + getOldPassword() + ",");
        if (getNewPassword() != nullsb.append("NewPassword: " + getNewPassword() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getOldPassword() == null) ? 0 : getOldPassword().hashCode()); 
        hashCode = prime * hashCode + ((getNewPassword() == null) ? 0 : getNewPassword().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ChangePasswordRequest == falsereturn false;
        ChangePasswordRequest other = (ChangePasswordRequest)obj;
        
        if (other.getOldPassword() == null ^ this.getOldPassword() == nullreturn false;
        if (other.getOldPassword() != null && other.getOldPassword().equals(this.getOldPassword()) == falsereturn false
        if (other.getNewPassword() == null ^ this.getNewPassword() == nullreturn false;
        if (other.getNewPassword() != null && other.getNewPassword().equals(this.getNewPassword()) == falsereturn false
        return true;
    }
    
    @Override
    public ChangePasswordRequest clone() {
        
            return (ChangePasswordRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X