/** * 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("DomainDescriptionType").add("UserPoolId", userPoolId()).add("AWSAccountId", awsAccountId()) .add("Domain", domain()).add("S3Bucket", s3Bucket()).add("CloudFrontDistribution", cloudFrontDistribution()) .add("Version", version()).add("Status", statusAsString()).add("CustomDomainConfig", customDomainConfig()) .build(); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(userPoolId()); hashCode = 31 * hashCode + Objects.hashCode(awsAccountId()); hashCode = 31 * hashCode + Objects.hashCode(domain()); hashCode = 31 * hashCode + Objects.hashCode(s3Bucket()); hashCode = 31 * hashCode + Objects.hashCode(cloudFrontDistribution()); hashCode = 31 * hashCode + Objects.hashCode(version()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(customDomainConfig()); return hashCode; }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "UserPoolId": return Optional.ofNullable(clazz.cast(userPoolId())); case "AWSAccountId": return Optional.ofNullable(clazz.cast(awsAccountId())); case "Domain": return Optional.ofNullable(clazz.cast(domain())); case "S3Bucket": return Optional.ofNullable(clazz.cast(s3Bucket())); case "CloudFrontDistribution": return Optional.ofNullable(clazz.cast(cloudFrontDistribution())); case "Version": return Optional.ofNullable(clazz.cast(version())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "CustomDomainConfig": return Optional.ofNullable(clazz.cast(customDomainConfig())); default: return Optional.empty(); } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof DomainDescriptionType)) { return false; } DomainDescriptionType other = (DomainDescriptionType) obj; return Objects.equals(userPoolId(), other.userPoolId()) && Objects.equals(awsAccountId(), other.awsAccountId()) && Objects.equals(domain(), other.domain()) && Objects.equals(s3Bucket(), other.s3Bucket()) && Objects.equals(cloudFrontDistribution(), other.cloudFrontDistribution()) && Objects.equals(version(), other.version()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(customDomainConfig(), other.customDomainConfig()); }