/*
 * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights
 * Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.amazonaws.services.dynamodbv2.pojos;

import java.util.Date;

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGenerateStrategy;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGenerated;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGeneratedTimestamp;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBRangeKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;

@DynamoDBTable(tableName = "aws-java-sdk-string-range")
public class PrimaryKeysNotAutogenerated_OtherAttributeAutogenerated {

    private String key;
    private String rangeKey;
    private Date otherAttribute;

    @DynamoDBHashKey
    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    @DynamoDBRangeKey
    public String getRangeKey() {
        return rangeKey;
    }

    public void setRangeKey(String rangeKey) {
        this.rangeKey = rangeKey;
    }

    @DynamoDBAutoGeneratedTimestamp
    public Date getOtherAttribute() {
        return otherAttribute;
    }

    public void setOtherAttribute(Date otherAttribute) {
        this.otherAttribute = otherAttribute;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((key == null) ? 0 : key.hashCode());
        result = prime * result + ((otherAttribute == null) ? 0 : otherAttribute.hashCode());
        result = prime * result + ((rangeKey == null) ? 0 : rangeKey.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if ( this == obj )
            return true;
        if ( obj == null )
            return false;
        if ( getClass() != obj.getClass() )
            return false;
        PrimaryKeysNotAutogenerated_OtherAttributeAutogenerated other = (PrimaryKeysNotAutogenerated_OtherAttributeAutogenerated) obj;
        if ( key == null ) {
            if ( other.key != null )
                return false;
        } else if ( !key.equals(other.key) )
            return false;
        if ( otherAttribute == null ) {
            if ( other.otherAttribute != null )
                return false;
        } else if ( !otherAttribute.equals(other.otherAttribute) )
            return false;
        if ( rangeKey == null ) {
            if ( other.rangeKey != null )
                return false;
        } else if ( !rangeKey.equals(other.rangeKey) )
            return false;
        return true;
    }
}
