/** * 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("UpdateTableRequest").add("AttributeDefinitions", attributeDefinitions()) .add("TableName", tableName()).add("BillingMode", billingModeAsString()) .add("ProvisionedThroughput", provisionedThroughput()) .add("GlobalSecondaryIndexUpdates", globalSecondaryIndexUpdates()) .add("StreamSpecification", streamSpecification()).add("SSESpecification", sseSpecification()).build(); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(attributeDefinitions()); hashCode = 31 * hashCode + Objects.hashCode(tableName()); hashCode = 31 * hashCode + Objects.hashCode(billingModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(provisionedThroughput()); hashCode = 31 * hashCode + Objects.hashCode(globalSecondaryIndexUpdates()); hashCode = 31 * hashCode + Objects.hashCode(streamSpecification()); hashCode = 31 * hashCode + Objects.hashCode(sseSpecification()); return hashCode; }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "AttributeDefinitions": return Optional.ofNullable(clazz.cast(attributeDefinitions())); case "TableName": return Optional.ofNullable(clazz.cast(tableName())); case "BillingMode": return Optional.ofNullable(clazz.cast(billingModeAsString())); case "ProvisionedThroughput": return Optional.ofNullable(clazz.cast(provisionedThroughput())); case "GlobalSecondaryIndexUpdates": return Optional.ofNullable(clazz.cast(globalSecondaryIndexUpdates())); case "StreamSpecification": return Optional.ofNullable(clazz.cast(streamSpecification())); case "SSESpecification": return Optional.ofNullable(clazz.cast(sseSpecification())); default: return Optional.empty(); } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UpdateTableRequest)) { return false; } UpdateTableRequest other = (UpdateTableRequest) obj; return Objects.equals(attributeDefinitions(), other.attributeDefinitions()) && Objects.equals(tableName(), other.tableName()) && Objects.equals(billingModeAsString(), other.billingModeAsString()) && Objects.equals(provisionedThroughput(), other.provisionedThroughput()) && Objects.equals(globalSecondaryIndexUpdates(), other.globalSecondaryIndexUpdates()) && Objects.equals(streamSpecification(), other.streamSpecification()) && Objects.equals(sseSpecification(), other.sseSpecification()); }