Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.model;
 

Represents a request to perform a DeleteItem operation on an item.

 
 public class DeleteRequest implements SerializableCloneable {

    
A map of attribute name to attribute values, representing the primary key of the item to delete. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema.
 
     private java.util.Map<String,AttributeValuekey;

    
Default constructor for a new DeleteRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public DeleteRequest() {}
    
    
Constructs a new DeleteRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
key A map of attribute name to attribute values, representing the primary key of the item to delete. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema.
 
     public DeleteRequest(java.util.Map<String,AttributeValuekey) {
         setKey(key);
     }

    
A map of attribute name to attribute values, representing the primary key of the item to delete. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema.

Returns:
A map of attribute name to attribute values, representing the primary key of the item to delete. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema.
 
     public java.util.Map<String,AttributeValuegetKey() {
         
         return ;
     }
    
    
A map of attribute name to attribute values, representing the primary key of the item to delete. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema.

Parameters:
key A map of attribute name to attribute values, representing the primary key of the item to delete. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema.
 
     public void setKey(java.util.Map<String,AttributeValuekey) {
         this. = key;
     }
    
    
A map of attribute name to attribute values, representing the primary key of the item to delete. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema.

Returns a reference to this object so that method calls can be chained together.

Parameters:
key A map of attribute name to attribute values, representing the primary key of the item to delete. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema.
Returns:
A reference to this updated object so that method calls can be chained together.
        setKey(key);
        return this;
    }

    
A map of attribute name to attribute values, representing the primary key of the item to delete. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema.

This method accepts the hashKey, rangeKey of Key as java.util.Map.Entry<String, AttributeValue> objects.

Parameters:
hashKey Primary hash key.
rangeKey Primary range key. (null if it a hash-only table)
    public void setKey(java.util.Map.Entry<StringAttributeValuehashKeyjava.util.Map.Entry<StringAttributeValuerangeKeythrows IllegalArgumentException {
      
      if (hashKey != null) {
          key.put(hashKey.getKey(), hashKey.getValue());
      } else
            throw new IllegalArgumentException("hashKey must be non-null object.");
      if (rangeKey != null) {
          key.put(rangeKey.getKey(), rangeKey.getValue());
      } 
        setKey(key);
    }
    
    
A map of attribute name to attribute values, representing the primary key of the item to delete. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema.

This method accepts the hashKey, rangeKey of Key as java.util.Map.Entry<String, AttributeValue> objects.

Returns a reference to this object so that method calls can be chained together.

Parameters:
hashKey Primary hash key.
rangeKey Primary range key. (null if it a hash-only table)
      setKey(hashKeyrangeKey);
      return this;
    }

    
A map of attribute name to attribute values, representing the primary key of the item to delete. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema.

The method adds a new key-value pair into Key parameter, and returns a reference to this object so that method calls can be chained together.

Parameters:
key The key of the entry to be added into Key.
value The corresponding value of the entry to be added into Key.
  public DeleteRequest addKeyEntry(String keyAttributeValue value) {
    if (null == this.) {
      this. = new java.util.HashMap<String,AttributeValue>();
    }
    if (this..containsKey(key))
      throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
    this..put(keyvalue);
    return this;
  }

  
Removes all the entries added into Key.

Returns a reference to this object so that method calls can be chained together.

    this. = null;
    return this;
  }
  
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getKey() != nullsb.append("Key: " + getKey() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DeleteRequest == falsereturn false;
        DeleteRequest other = (DeleteRequest)obj;
        
        if (other.getKey() == null ^ this.getKey() == nullreturn false;
        if (other.getKey() != null && other.getKey().equals(this.getKey()) == falsereturn false
        return true;
    }
    
    @Override
    public DeleteRequest clone() {
        try {
            return (DeleteRequestsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X