shiver.me.timbers.aws.dynamodb.TableKeySchema Maven / Gradle / Ivy
Show all versions of smt-cloudformation-objects Show documentation
package shiver.me.timbers.aws.dynamodb;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import shiver.me.timbers.aws.Property;
/**
* TableKeySchema
*
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html
*
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonPropertyOrder({
"AttributeName",
"KeyType"
})
public class TableKeySchema implements Property
{
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html#aws-properties-dynamodb-keyschema-attributename
*
*/
@JsonProperty("AttributeName")
@JsonPropertyDescription("http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html#aws-properties-dynamodb-keyschema-attributename")
private CharSequence attributeName;
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html#aws-properties-dynamodb-keyschema-keytype
*
*/
@JsonProperty("KeyType")
@JsonPropertyDescription("http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html#aws-properties-dynamodb-keyschema-keytype")
private CharSequence keyType;
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html#aws-properties-dynamodb-keyschema-attributename
*
*/
@JsonIgnore
public CharSequence getAttributeName() {
return attributeName;
}
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html#aws-properties-dynamodb-keyschema-attributename
*
*/
@JsonIgnore
public void setAttributeName(CharSequence attributeName) {
this.attributeName = attributeName;
}
public TableKeySchema withAttributeName(CharSequence attributeName) {
this.attributeName = attributeName;
return this;
}
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html#aws-properties-dynamodb-keyschema-keytype
*
*/
@JsonIgnore
public CharSequence getKeyType() {
return keyType;
}
/**
* http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-keyschema.html#aws-properties-dynamodb-keyschema-keytype
*
*/
@JsonIgnore
public void setKeyType(CharSequence keyType) {
this.keyType = keyType;
}
public TableKeySchema withKeyType(CharSequence keyType) {
this.keyType = keyType;
return this;
}
@Override
public String toString() {
return new ToStringBuilder(this).append("attributeName", attributeName).append("keyType", keyType).toString();
}
@Override
public int hashCode() {
return new HashCodeBuilder().append(keyType).append(attributeName).toHashCode();
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof TableKeySchema) == false) {
return false;
}
TableKeySchema rhs = ((TableKeySchema) other);
return new EqualsBuilder().append(keyType, rhs.keyType).append(attributeName, rhs.attributeName).isEquals();
}
}