public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "PreviousPassword": return Optional.ofNullable(clazz.cast(previousPassword())); case "ProposedPassword": return Optional.ofNullable(clazz.cast(proposedPassword())); case "AccessToken": return Optional.ofNullable(clazz.cast(accessToken())); default: return Optional.empty(); } }
/** * 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. */ @Override public String toString() { return ToString.builder("ChangePasswordRequest") .add("PreviousPassword", previousPassword() == null ? null : "*** Sensitive Data Redacted ***") .add("ProposedPassword", proposedPassword() == null ? null : "*** Sensitive Data Redacted ***") .add("AccessToken", accessToken() == null ? null : "*** Sensitive Data Redacted ***").build(); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(previousPassword()); hashCode = 31 * hashCode + Objects.hashCode(proposedPassword()); hashCode = 31 * hashCode + Objects.hashCode(accessToken()); return hashCode; }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "PreviousPassword": return Optional.ofNullable(clazz.cast(previousPassword())); case "ProposedPassword": return Optional.ofNullable(clazz.cast(proposedPassword())); case "AccessToken": return Optional.ofNullable(clazz.cast(accessToken())); default: return Optional.empty(); } }
@Override public String toString() { return ToString.builder("ChangePasswordRequest").add("PreviousPassword", previousPassword()) .add("ProposedPassword", proposedPassword()).add("AccessToken", accessToken()).build(); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(previousPassword()); hashCode = 31 * hashCode + Objects.hashCode(proposedPassword()); hashCode = 31 * hashCode + Objects.hashCode(accessToken()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ChangePasswordRequest)) { return false; } ChangePasswordRequest other = (ChangePasswordRequest) obj; return Objects.equals(previousPassword(), other.previousPassword()) && Objects.equals(proposedPassword(), other.proposedPassword()) && Objects.equals(accessToken(), other.accessToken()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ChangePasswordRequest)) { return false; } ChangePasswordRequest other = (ChangePasswordRequest) obj; return Objects.equals(previousPassword(), other.previousPassword()) && Objects.equals(proposedPassword(), other.proposedPassword()) && Objects.equals(accessToken(), other.accessToken()); }
/** * Marshall the given parameter object */ public void marshall(ChangePasswordRequest changePasswordRequest, ProtocolMarshaller protocolMarshaller) { Validate.paramNotNull(changePasswordRequest, "changePasswordRequest"); Validate.paramNotNull(protocolMarshaller, "protocolMarshaller"); try { protocolMarshaller.marshall(changePasswordRequest.previousPassword(), PREVIOUSPASSWORD_BINDING); protocolMarshaller.marshall(changePasswordRequest.proposedPassword(), PROPOSEDPASSWORD_BINDING); protocolMarshaller.marshall(changePasswordRequest.accessToken(), ACCESSTOKEN_BINDING); } catch (Exception e) { throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build(); } } }