public AuthenticationMode withPasswords(String... passwords) {
        if (this.passwords == null) {
            setPasswords(new com.amazonaws.internal.SdkInternalList<String>(passwords.length));
        }
        for (String ele : passwords) {
            this.passwords.add(ele);
        }
        return this;
    }
<p>
Specifies the passwords to use for authentication if <code>Type</code> is set to <code>password</code>.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setPasswords(java.util.Collection)} or {@link #withPasswords(java.util.Collection)} if you want to
override the existing values.
</p>

@param passwords
       Specifies the passwords to use for authentication if <code>Type</code> is set to <code>password</code>.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-elasticache/src/main/java/com/amazonaws/services/elasticache/model/AuthenticationMode.java