/** * 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("CreateTableRequest").add("AttributeDefinitions", attributeDefinitions()) .add("TableName", tableName()).add("KeySchema", keySchema()) .add("LocalSecondaryIndexes", localSecondaryIndexes()).add("GlobalSecondaryIndexes", globalSecondaryIndexes()) .add("BillingMode", billingModeAsString()).add("ProvisionedThroughput", provisionedThroughput()) .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(keySchema()); hashCode = 31 * hashCode + Objects.hashCode(localSecondaryIndexes()); hashCode = 31 * hashCode + Objects.hashCode(globalSecondaryIndexes()); hashCode = 31 * hashCode + Objects.hashCode(billingModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(provisionedThroughput()); 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 "KeySchema": return Optional.ofNullable(clazz.cast(keySchema())); case "LocalSecondaryIndexes": return Optional.ofNullable(clazz.cast(localSecondaryIndexes())); case "GlobalSecondaryIndexes": return Optional.ofNullable(clazz.cast(globalSecondaryIndexes())); case "BillingMode": return Optional.ofNullable(clazz.cast(billingModeAsString())); case "ProvisionedThroughput": return Optional.ofNullable(clazz.cast(provisionedThroughput())); 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 CreateTableRequest)) { return false; } CreateTableRequest other = (CreateTableRequest) obj; return Objects.equals(attributeDefinitions(), other.attributeDefinitions()) && Objects.equals(tableName(), other.tableName()) && Objects.equals(keySchema(), other.keySchema()) && Objects.equals(localSecondaryIndexes(), other.localSecondaryIndexes()) && Objects.equals(globalSecondaryIndexes(), other.globalSecondaryIndexes()) && Objects.equals(billingModeAsString(), other.billingModeAsString()) && Objects.equals(provisionedThroughput(), other.provisionedThroughput()) && Objects.equals(streamSpecification(), other.streamSpecification()) && Objects.equals(sseSpecification(), other.sseSpecification()); }