com.amazonaws.services.dynamodb.model
Class GetItemRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.dynamodb.model.GetItemRequest

public class GetItemRequest
extends AmazonWebServiceRequest

Container for the parameters to the GetItem operation.

Retrieves a set of Attributes for an item that matches the primary key.

The GetItem operation provides an eventually-consistent read by default. If eventually-consistent reads are not acceptable for your application, use ConsistentRead . Although this operation might take longer than a standard read, it always returns the last updated value.

See Also:
AmazonDynamoDB.getItem(GetItemRequest)

Constructor Summary
GetItemRequest()
          Default constructor for a new GetItemRequest object.
GetItemRequest(String tableName, Key key)
          Constructs a new GetItemRequest object.
 
Method Summary
 boolean equals(Object obj)
           
 List<String> getAttributesToGet()
          List of Attribute names.
 Boolean getConsistentRead()
          If set to true, then a consistent read is issued.
 Key getKey()
          The primary key that uniquely identifies each item in a table.
 String getTableName()
          The name of the table in which you want to get an item.
 int hashCode()
           
 Boolean isConsistentRead()
          If set to true, then a consistent read is issued.
 void setAttributesToGet(Collection<String> attributesToGet)
          List of Attribute names.
 void setConsistentRead(Boolean consistentRead)
          If set to true, then a consistent read is issued.
 void setKey(Key key)
          The primary key that uniquely identifies each item in a table.
 void setTableName(String tableName)
          The name of the table in which you want to get an item.
 String toString()
          Returns a string representation of this object; useful for testing and debugging.
 GetItemRequest withAttributesToGet(Collection<String> attributesToGet)
          List of Attribute names.
 GetItemRequest withAttributesToGet(String... attributesToGet)
          List of Attribute names.
 GetItemRequest withConsistentRead(Boolean consistentRead)
          If set to true, then a consistent read is issued.
 GetItemRequest withKey(Key key)
          The primary key that uniquely identifies each item in a table.
 GetItemRequest withTableName(String tableName)
          The name of the table in which you want to get an item.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, setDelegationToken, setRequestCredentials
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GetItemRequest

public GetItemRequest()
Default constructor for a new GetItemRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.


GetItemRequest

public GetItemRequest(String tableName,
                      Key key)
Constructs a new GetItemRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
tableName - The name of the table in which you want to get an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).
key - The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.
Method Detail

getTableName

public String getTableName()
The name of the table in which you want to get an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+

Returns:
The name of the table in which you want to get an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

setTableName

public void setTableName(String tableName)
The name of the table in which you want to get an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+

Parameters:
tableName - The name of the table in which you want to get an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

withTableName

public GetItemRequest withTableName(String tableName)
The name of the table in which you want to get an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

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

Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+

Parameters:
tableName - The name of the table in which you want to get an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).
Returns:
A reference to this updated object so that method calls can be chained together.

getKey

public Key getKey()
The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.

Returns:
The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.

setKey

public void setKey(Key key)
The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.

Parameters:
key - The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.

withKey

public GetItemRequest withKey(Key key)
The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.

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

Parameters:
key - The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.
Returns:
A reference to this updated object so that method calls can be chained together.

getAttributesToGet

public List<String> getAttributesToGet()
List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.

Constraints:
Length: 1 -

Returns:
List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.

setAttributesToGet

public void setAttributesToGet(Collection<String> attributesToGet)
List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.

Constraints:
Length: 1 -

Parameters:
attributesToGet - List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.

withAttributesToGet

public GetItemRequest withAttributesToGet(String... attributesToGet)
List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.

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

Constraints:
Length: 1 -

Parameters:
attributesToGet - List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.
Returns:
A reference to this updated object so that method calls can be chained together.

withAttributesToGet

public GetItemRequest withAttributesToGet(Collection<String> attributesToGet)
List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.

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

Constraints:
Length: 1 -

Parameters:
attributesToGet - List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.
Returns:
A reference to this updated object so that method calls can be chained together.

isConsistentRead

public Boolean isConsistentRead()
If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.

Returns:
If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.

setConsistentRead

public void setConsistentRead(Boolean consistentRead)
If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.

Parameters:
consistentRead - If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.

withConsistentRead

public GetItemRequest withConsistentRead(Boolean consistentRead)
If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.

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

Parameters:
consistentRead - If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.
Returns:
A reference to this updated object so that method calls can be chained together.

getConsistentRead

public Boolean getConsistentRead()
If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.

Returns:
If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.

toString

public String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.