@Override public String toString() { return ToString.builder("SignUpRequest").add("ClientId", clientId()).add("SecretHash", secretHash()) .add("Username", username()).add("Password", password()).add("UserAttributes", userAttributes()) .add("ValidationData", validationData()).build(); }
/** * 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("SignUpRequest").add("ClientId", clientId() == null ? null : "*** Sensitive Data Redacted ***") .add("SecretHash", secretHash() == null ? null : "*** Sensitive Data Redacted ***") .add("Username", username() == null ? null : "*** Sensitive Data Redacted ***") .add("Password", password() == null ? null : "*** Sensitive Data Redacted ***") .add("UserAttributes", userAttributes()).add("ValidationData", validationData()) .add("AnalyticsMetadata", analyticsMetadata()).add("UserContextData", userContextData()).build(); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(clientId()); hashCode = 31 * hashCode + Objects.hashCode(secretHash()); hashCode = 31 * hashCode + Objects.hashCode(username()); hashCode = 31 * hashCode + Objects.hashCode(password()); hashCode = 31 * hashCode + Objects.hashCode(userAttributes()); hashCode = 31 * hashCode + Objects.hashCode(validationData()); return hashCode; }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "ClientId": return Optional.ofNullable(clazz.cast(clientId())); case "SecretHash": return Optional.ofNullable(clazz.cast(secretHash())); case "Username": return Optional.ofNullable(clazz.cast(username())); case "Password": return Optional.ofNullable(clazz.cast(password())); case "UserAttributes": return Optional.ofNullable(clazz.cast(userAttributes())); case "ValidationData": return Optional.ofNullable(clazz.cast(validationData())); default: return Optional.empty(); } }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "ClientId": return Optional.ofNullable(clazz.cast(clientId())); case "SecretHash": return Optional.ofNullable(clazz.cast(secretHash())); case "Username": return Optional.ofNullable(clazz.cast(username())); case "Password": return Optional.ofNullable(clazz.cast(password())); case "UserAttributes": return Optional.ofNullable(clazz.cast(userAttributes())); case "ValidationData": return Optional.ofNullable(clazz.cast(validationData())); case "AnalyticsMetadata": return Optional.ofNullable(clazz.cast(analyticsMetadata())); case "UserContextData": return Optional.ofNullable(clazz.cast(userContextData())); default: return Optional.empty(); } }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(clientId()); hashCode = 31 * hashCode + Objects.hashCode(secretHash()); hashCode = 31 * hashCode + Objects.hashCode(username()); hashCode = 31 * hashCode + Objects.hashCode(password()); hashCode = 31 * hashCode + Objects.hashCode(userAttributes()); hashCode = 31 * hashCode + Objects.hashCode(validationData()); hashCode = 31 * hashCode + Objects.hashCode(analyticsMetadata()); hashCode = 31 * hashCode + Objects.hashCode(userContextData()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SignUpRequest)) { return false; } SignUpRequest other = (SignUpRequest) obj; return Objects.equals(clientId(), other.clientId()) && Objects.equals(secretHash(), other.secretHash()) && Objects.equals(username(), other.username()) && Objects.equals(password(), other.password()) && Objects.equals(userAttributes(), other.userAttributes()) && Objects.equals(validationData(), other.validationData()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SignUpRequest)) { return false; } SignUpRequest other = (SignUpRequest) obj; return Objects.equals(clientId(), other.clientId()) && Objects.equals(secretHash(), other.secretHash()) && Objects.equals(username(), other.username()) && Objects.equals(password(), other.password()) && Objects.equals(userAttributes(), other.userAttributes()) && Objects.equals(validationData(), other.validationData()) && Objects.equals(analyticsMetadata(), other.analyticsMetadata()) && Objects.equals(userContextData(), other.userContextData()); }
/** * Marshall the given parameter object */ public void marshall(SignUpRequest signUpRequest, ProtocolMarshaller protocolMarshaller) { Validate.paramNotNull(signUpRequest, "signUpRequest"); Validate.paramNotNull(protocolMarshaller, "protocolMarshaller"); try { protocolMarshaller.marshall(signUpRequest.clientId(), CLIENTID_BINDING); protocolMarshaller.marshall(signUpRequest.secretHash(), SECRETHASH_BINDING); protocolMarshaller.marshall(signUpRequest.username(), USERNAME_BINDING); protocolMarshaller.marshall(signUpRequest.password(), PASSWORD_BINDING); protocolMarshaller.marshall(signUpRequest.userAttributes(), USERATTRIBUTES_BINDING); protocolMarshaller.marshall(signUpRequest.validationData(), VALIDATIONDATA_BINDING); } catch (Exception e) { throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build(); } } }