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 the output of a BatchGetItem operation.

 
 public class BatchGetItemResult implements SerializableCloneable {

    
A map of table name to a list of items. Each object in Responses consists of a table name, along with a map of attribute data consisting of the data type and attribute value.
 
A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section.

Each element consists of:

  • Keys - An array of primary key attribute values that define specific items in the table.

  • AttributesToGet - One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result.

  • ConsistentRead - The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.

If there are no unprocessed keys remaining, the response contains an empty UnprocessedKeys map.

Constraints:
Length: 1 - 100

 
     private java.util.Map<String,KeysAndAttributesunprocessedKeys;

    
The read capacity units consumed by the operation.

Each element consists of:

  • TableName - The table that consumed the provisioned throughput.

  • CapacityUnits - The total number of capacity units consumed.

 
A map of table name to a list of items. Each object in Responses consists of a table name, along with a map of attribute data consisting of the data type and attribute value.

Returns:
A map of table name to a list of items. Each object in Responses consists of a table name, along with a map of attribute data consisting of the data type and attribute value.
 
         
         return ;
     }
    
    
A map of table name to a list of items. Each object in Responses consists of a table name, along with a map of attribute data consisting of the data type and attribute value.

Parameters:
responses A map of table name to a list of items. Each object in Responses consists of a table name, along with a map of attribute data consisting of the data type and attribute value.
 
     public void setResponses(java.util.Map<String,java.util.List<java.util.Map<String,AttributeValue>>> responses) {
         this. = responses;
     }
    
    
A map of table name to a list of items. Each object in Responses consists of a table name, along with a map of attribute data consisting of the data type and attribute value.

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

Parameters:
responses A map of table name to a list of items. Each object in Responses consists of a table name, along with a map of attribute data consisting of the data type and attribute value.
Returns:
A reference to this updated object so that method calls can be chained together.
        setResponses(responses);
        return this;
    }

    
A map of table name to a list of items. Each object in Responses consists of a table name, along with a map of attribute data consisting of the data type and attribute value.

The method adds a new key-value pair into Responses 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 Responses.
value The corresponding value of the entry to be added into Responses.
    if (null == this.) {
    }
    if (this..containsKey(key))
      throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
    this..put(keyvalue);
    return this;
  }

  
Removes all the entries added into Responses.

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

    this. = null;
    return this;
  }
  
    
A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section.

Each element consists of:

  • Keys - An array of primary key attribute values that define specific items in the table.

  • AttributesToGet - One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result.

  • ConsistentRead - The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.

If there are no unprocessed keys remaining, the response contains an empty UnprocessedKeys map.

Constraints:
Length: 1 - 100

Returns:
A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section.

Each element consists of:

  • Keys - An array of primary key attribute values that define specific items in the table.

  • AttributesToGet - One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result.

  • ConsistentRead - The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.

If there are no unprocessed keys remaining, the response contains an empty UnprocessedKeys map.

        
        return ;
    }
    
    
A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section.

Each element consists of:

  • Keys - An array of primary key attribute values that define specific items in the table.

  • AttributesToGet - One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result.

  • ConsistentRead - The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.

If there are no unprocessed keys remaining, the response contains an empty UnprocessedKeys map.

Constraints:
Length: 1 - 100

Parameters:
unprocessedKeys A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section.

Each element consists of:

  • Keys - An array of primary key attribute values that define specific items in the table.

  • AttributesToGet - One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result.

  • ConsistentRead - The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.

If there are no unprocessed keys remaining, the response contains an empty UnprocessedKeys map.

    public void setUnprocessedKeys(java.util.Map<String,KeysAndAttributesunprocessedKeys) {
        this. = unprocessedKeys;
    }
    
    
A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section.

Each element consists of:

  • Keys - An array of primary key attribute values that define specific items in the table.

  • AttributesToGet - One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result.

  • ConsistentRead - The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.

If there are no unprocessed keys remaining, the response contains an empty UnprocessedKeys map.

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

Constraints:
Length: 1 - 100

Parameters:
unprocessedKeys A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section.

Each element consists of:

  • Keys - An array of primary key attribute values that define specific items in the table.

  • AttributesToGet - One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result.

  • ConsistentRead - The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.

If there are no unprocessed keys remaining, the response contains an empty UnprocessedKeys map.

Returns:
A reference to this updated object so that method calls can be chained together.
        setUnprocessedKeys(unprocessedKeys);
        return this;
    }

    
A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section.

Each element consists of:

  • Keys - An array of primary key attribute values that define specific items in the table.

  • AttributesToGet - One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result.

  • ConsistentRead - The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.

If there are no unprocessed keys remaining, the response contains an empty UnprocessedKeys map.

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

Constraints:
Length: 1 - 100

Parameters:
key The key of the entry to be added into UnprocessedKeys.
value The corresponding value of the entry to be added into UnprocessedKeys.
    if (null == this.) {
    }
    if (this..containsKey(key))
      throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
    this..put(keyvalue);
    return this;
  }

  
Removes all the entries added into UnprocessedKeys.

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

    this. = null;
    return this;
  }
  
    
The read capacity units consumed by the operation.

Each element consists of:

  • TableName - The table that consumed the provisioned throughput.

  • CapacityUnits - The total number of capacity units consumed.

Returns:
The read capacity units consumed by the operation.

Each element consists of:

  • TableName - The table that consumed the provisioned throughput.

  • CapacityUnits - The total number of capacity units consumed.

        return ;
    }
    
    
The read capacity units consumed by the operation.

Each element consists of:

  • TableName - The table that consumed the provisioned throughput.

  • CapacityUnits - The total number of capacity units consumed.

Parameters:
consumedCapacity The read capacity units consumed by the operation.

Each element consists of:

  • TableName - The table that consumed the provisioned throughput.

  • CapacityUnits - The total number of capacity units consumed.

    public void setConsumedCapacity(java.util.Collection<ConsumedCapacityconsumedCapacity) {
        if (consumedCapacity == null) {
            this. = null;
            return;
        }
        consumedCapacityCopy.addAll(consumedCapacity);
        this. = consumedCapacityCopy;
    }
    
    
The read capacity units consumed by the operation.

Each element consists of:

  • TableName - The table that consumed the provisioned throughput.

  • CapacityUnits - The total number of capacity units consumed.

NOTE: This method appends the values to the existing list (if any). Use setConsumedCapacity(java.util.Collection) or withConsumedCapacity(java.util.Collection) if you want to override the existing values.

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

Parameters:
consumedCapacity The read capacity units consumed by the operation.

Each element consists of:

  • TableName - The table that consumed the provisioned throughput.

  • CapacityUnits - The total number of capacity units consumed.

Returns:
A reference to this updated object so that method calls can be chained together.
    public BatchGetItemResult withConsumedCapacity(ConsumedCapacity... consumedCapacity) {
        if (getConsumedCapacity() == nullsetConsumedCapacity(new java.util.ArrayList<ConsumedCapacity>(consumedCapacity.length));
        for (ConsumedCapacity value : consumedCapacity) {
            getConsumedCapacity().add(value);
        }
        return this;
    }
    
    
The read capacity units consumed by the operation.

Each element consists of:

  • TableName - The table that consumed the provisioned throughput.

  • CapacityUnits - The total number of capacity units consumed.

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

Parameters:
consumedCapacity The read capacity units consumed by the operation.

Each element consists of:

  • TableName - The table that consumed the provisioned throughput.

  • CapacityUnits - The total number of capacity units consumed.

Returns:
A reference to this updated object so that method calls can be chained together.
        if (consumedCapacity == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<ConsumedCapacityconsumedCapacityCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<ConsumedCapacity>(consumedCapacity.size());
            consumedCapacityCopy.addAll(consumedCapacity);
            this. = consumedCapacityCopy;
        }
        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 (getResponses() != nullsb.append("Responses: " + getResponses() + ",");
        if (getUnprocessedKeys() != nullsb.append("UnprocessedKeys: " + getUnprocessedKeys() + ",");
        if (getConsumedCapacity() != nullsb.append("ConsumedCapacity: " + getConsumedCapacity() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getResponses() == null) ? 0 : getResponses().hashCode()); 
        hashCode = prime * hashCode + ((getUnprocessedKeys() == null) ? 0 : getUnprocessedKeys().hashCode()); 
        hashCode = prime * hashCode + ((getConsumedCapacity() == null) ? 0 : getConsumedCapacity().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof BatchGetItemResult == falsereturn false;
        BatchGetItemResult other = (BatchGetItemResult)obj;
        
        if (other.getResponses() == null ^ this.getResponses() == nullreturn false;
        if (other.getResponses() != null && other.getResponses().equals(this.getResponses()) == falsereturn false
        if (other.getUnprocessedKeys() == null ^ this.getUnprocessedKeys() == nullreturn false;
        if (other.getUnprocessedKeys() != null && other.getUnprocessedKeys().equals(this.getUnprocessedKeys()) == falsereturn false
        if (other.getConsumedCapacity() == null ^ this.getConsumedCapacity() == nullreturn false;
        if (other.getConsumedCapacity() != null && other.getConsumedCapacity().equals(this.getConsumedCapacity()) == falsereturn false
        return true;
    }
    
    @Override
    public BatchGetItemResult clone() {
        try {
            return (BatchGetItemResultsuper.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