@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetAccountPasswordPolicyResult == false) return false; GetAccountPasswordPolicyResult other = (GetAccountPasswordPolicyResult) obj; if (other.getPasswordPolicy() == null ^ this.getPasswordPolicy() == null) return false; if (other.getPasswordPolicy() != null && other.getPasswordPolicy().equals(this.getPasswordPolicy()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPasswordPolicy() == null) ? 0 : getPasswordPolicy().hashCode()); return hashCode; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getPasswordPolicy() != null) sb.append("PasswordPolicy: ").append(getPasswordPolicy()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetAccountPasswordPolicyResult == false) return false; GetAccountPasswordPolicyResult other = (GetAccountPasswordPolicyResult) obj; if (other.getPasswordPolicy() == null ^ this.getPasswordPolicy() == null) return false; if (other.getPasswordPolicy() != null && other.getPasswordPolicy().equals(this.getPasswordPolicy()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPasswordPolicy() == null) ? 0 : getPasswordPolicy().hashCode()); return hashCode; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getPasswordPolicy() != null) sb.append("PasswordPolicy: ").append(getPasswordPolicy()); sb.append("}"); return sb.toString(); }
@Override public boolean backupExistingConfigForResource(String resourceId, String resourceType, Map<String, Object> clientMap, Map<String, String> ruleParams,Map<String, String> issue) throws AutoFixException { LOGGER.debug(String.format("backing up the config for %s" , resourceId)); AmazonIdentityManagementClient client = (AmazonIdentityManagementClient) clientMap .get(PacmanSdkConstants.CLIENT); GetAccountPasswordPolicyResult accountPasswordPolicyResult = client.getAccountPasswordPolicy(); PasswordPolicy passwordPolicy = accountPasswordPolicyResult.getPasswordPolicy(); Gson gson = new GsonBuilder().create(); return backupOldConfig(resourceId, PASSWORD_POLICY, gson.toJson(passwordPolicy)); }
PasswordPolicy passwordPolicy = result.getPasswordPolicy();