/** * 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("UserType").add("Username", username() == null ? null : "*** Sensitive Data Redacted ***") .add("Attributes", attributes()).add("UserCreateDate", userCreateDate()) .add("UserLastModifiedDate", userLastModifiedDate()).add("Enabled", enabled()) .add("UserStatus", userStatusAsString()).add("MFAOptions", mfaOptions()).build(); }
@Override public String toString() { return ToString.builder("UserType").add("Username", username()).add("Attributes", attributes()) .add("UserCreateDate", userCreateDate()).add("UserLastModifiedDate", userLastModifiedDate()) .add("Enabled", enabled()).add("UserStatus", userStatusAsString()).add("MFAOptions", mfaOptions()).build(); }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "Username": return Optional.ofNullable(clazz.cast(username())); case "Attributes": return Optional.ofNullable(clazz.cast(attributes())); case "UserCreateDate": return Optional.ofNullable(clazz.cast(userCreateDate())); case "UserLastModifiedDate": return Optional.ofNullable(clazz.cast(userLastModifiedDate())); case "Enabled": return Optional.ofNullable(clazz.cast(enabled())); case "UserStatus": return Optional.ofNullable(clazz.cast(userStatusAsString())); case "MFAOptions": return Optional.ofNullable(clazz.cast(mfaOptions())); default: return Optional.empty(); } }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(username()); hashCode = 31 * hashCode + Objects.hashCode(attributes()); hashCode = 31 * hashCode + Objects.hashCode(userCreateDate()); hashCode = 31 * hashCode + Objects.hashCode(userLastModifiedDate()); hashCode = 31 * hashCode + Objects.hashCode(enabled()); hashCode = 31 * hashCode + Objects.hashCode(userStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(mfaOptions()); return hashCode; }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(username()); hashCode = 31 * hashCode + Objects.hashCode(attributes()); hashCode = 31 * hashCode + Objects.hashCode(userCreateDate()); hashCode = 31 * hashCode + Objects.hashCode(userLastModifiedDate()); hashCode = 31 * hashCode + Objects.hashCode(enabled()); hashCode = 31 * hashCode + Objects.hashCode(userStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(mfaOptions()); return hashCode; }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "Username": return Optional.ofNullable(clazz.cast(username())); case "Attributes": return Optional.ofNullable(clazz.cast(attributes())); case "UserCreateDate": return Optional.ofNullable(clazz.cast(userCreateDate())); case "UserLastModifiedDate": return Optional.ofNullable(clazz.cast(userLastModifiedDate())); case "Enabled": return Optional.ofNullable(clazz.cast(enabled())); case "UserStatus": return Optional.ofNullable(clazz.cast(userStatusAsString())); case "MFAOptions": return Optional.ofNullable(clazz.cast(mfaOptions())); default: return Optional.empty(); } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UserType)) { return false; } UserType other = (UserType) obj; return Objects.equals(username(), other.username()) && Objects.equals(attributes(), other.attributes()) && Objects.equals(userCreateDate(), other.userCreateDate()) && Objects.equals(userLastModifiedDate(), other.userLastModifiedDate()) && Objects.equals(enabled(), other.enabled()) && Objects.equals(userStatusAsString(), other.userStatusAsString()) && Objects.equals(mfaOptions(), other.mfaOptions()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UserType)) { return false; } UserType other = (UserType) obj; return Objects.equals(username(), other.username()) && Objects.equals(attributes(), other.attributes()) && Objects.equals(userCreateDate(), other.userCreateDate()) && Objects.equals(userLastModifiedDate(), other.userLastModifiedDate()) && Objects.equals(enabled(), other.enabled()) && Objects.equals(userStatusAsString(), other.userStatusAsString()) && Objects.equals(mfaOptions(), other.mfaOptions()); }
/** * Marshall the given parameter object */ public void marshall(UserType userType, ProtocolMarshaller protocolMarshaller) { Validate.paramNotNull(userType, "userType"); Validate.paramNotNull(protocolMarshaller, "protocolMarshaller"); try { protocolMarshaller.marshall(userType.username(), USERNAME_BINDING); protocolMarshaller.marshall(userType.attributes(), ATTRIBUTES_BINDING); protocolMarshaller.marshall(userType.userCreateDate(), USERCREATEDATE_BINDING); protocolMarshaller.marshall(userType.userLastModifiedDate(), USERLASTMODIFIEDDATE_BINDING); protocolMarshaller.marshall(userType.enabled(), ENABLED_BINDING); protocolMarshaller.marshall(userType.userStatusAsString(), USERSTATUS_BINDING); protocolMarshaller.marshall(userType.mfaOptions(), MFAOPTIONS_BINDING); } catch (Exception e) { throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build(); } } }