|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.AmazonWebServiceRequest
com.amazonaws.services.dynamodbv2.model.GetItemRequest
public class GetItemRequest
Container for the parameters to the GetItem operation
.
The GetItem operation returns a set of attributes for the item with the given primary key. If there is no matching item, GetItem does not return any data.
GetItem provides an eventually consistent read by default. If
your application requires a strongly consistent read, set
ConsistentRead to true
. Although a strongly
consistent read might take more time than an eventually consistent
read, it always returns the last updated value.
AmazonDynamoDB.getItem(GetItemRequest)
,
Serialized FormConstructor Summary | |
---|---|
GetItemRequest()
Default constructor for a new GetItemRequest object. |
|
GetItemRequest(java.lang.String tableName,
java.util.Map<java.lang.String,AttributeValue> key)
Constructs a new GetItemRequest object. |
|
GetItemRequest(java.lang.String tableName,
java.util.Map<java.lang.String,AttributeValue> key,
java.lang.Boolean consistentRead)
Constructs a new GetItemRequest object. |
Method Summary | |
---|---|
GetItemRequest |
addKeyEntry(java.lang.String key,
AttributeValue value)
A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve. |
GetItemRequest |
clearKeyEntries()
Removes all the entries added into Key. |
boolean |
equals(java.lang.Object obj)
|
java.util.List<java.lang.String> |
getAttributesToGet()
The names of one or more attributes to retrieve. |
java.lang.Boolean |
getConsistentRead()
If set to true , then the operation uses strongly
consistent reads; otherwise, eventually consistent reads are used. |
java.util.Map<java.lang.String,AttributeValue> |
getKey()
A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve. |
java.lang.String |
getReturnConsumedCapacity()
If set to TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
java.lang.String |
getTableName()
The name of the table containing the requested item. |
int |
hashCode()
|
java.lang.Boolean |
isConsistentRead()
If set to true , then the operation uses strongly
consistent reads; otherwise, eventually consistent reads are used. |
void |
setAttributesToGet(java.util.Collection<java.lang.String> attributesToGet)
The names of one or more attributes to retrieve. |
void |
setConsistentRead(java.lang.Boolean consistentRead)
If set to true , then the operation uses strongly
consistent reads; otherwise, eventually consistent reads are used. |
void |
setKey(java.util.Map.Entry<java.lang.String,AttributeValue> hashKey,
java.util.Map.Entry<java.lang.String,AttributeValue> rangeKey)
A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve. |
void |
setKey(java.util.Map<java.lang.String,AttributeValue> key)
A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve. |
void |
setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
If set to TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
void |
setReturnConsumedCapacity(java.lang.String returnConsumedCapacity)
If set to TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
void |
setTableName(java.lang.String tableName)
The name of the table containing the requested item. |
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and debugging. |
GetItemRequest |
withAttributesToGet(java.util.Collection<java.lang.String> attributesToGet)
The names of one or more attributes to retrieve. |
GetItemRequest |
withAttributesToGet(java.lang.String... attributesToGet)
The names of one or more attributes to retrieve. |
GetItemRequest |
withConsistentRead(java.lang.Boolean consistentRead)
If set to true , then the operation uses strongly
consistent reads; otherwise, eventually consistent reads are used. |
GetItemRequest |
withKey(java.util.Map.Entry<java.lang.String,AttributeValue> hashKey,
java.util.Map.Entry<java.lang.String,AttributeValue> rangeKey)
A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve. |
GetItemRequest |
withKey(java.util.Map<java.lang.String,AttributeValue> key)
A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve. |
GetItemRequest |
withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
If set to TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
GetItemRequest |
withReturnConsumedCapacity(java.lang.String returnConsumedCapacity)
If set to TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
GetItemRequest |
withTableName(java.lang.String tableName)
The name of the table containing the requested item. |
Methods inherited from class com.amazonaws.AmazonWebServiceRequest |
---|
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setDelegationToken, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GetItemRequest()
public GetItemRequest(java.lang.String tableName, java.util.Map<java.lang.String,AttributeValue> key)
tableName
- The name of the table containing the requested item.key
- A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve.public GetItemRequest(java.lang.String tableName, java.util.Map<java.lang.String,AttributeValue> key, java.lang.Boolean consistentRead)
tableName
- The name of the table containing the requested item.key
- A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve.consistentRead
- If set to true
, then the operation
uses strongly consistent reads; otherwise, eventually consistent reads
are used.Method Detail |
---|
public java.lang.String getTableName()
Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+
public void setTableName(java.lang.String tableName)
Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+
tableName
- The name of the table containing the requested item.public GetItemRequest withTableName(java.lang.String tableName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+
tableName
- The name of the table containing the requested item.
public java.util.Map<java.lang.String,AttributeValue> getKey()
public void setKey(java.util.Map<java.lang.String,AttributeValue> key)
key
- A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve.public GetItemRequest withKey(java.util.Map<java.lang.String,AttributeValue> key)
Returns a reference to this object so that method calls can be chained together.
key
- A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve.
public void setKey(java.util.Map.Entry<java.lang.String,AttributeValue> hashKey, java.util.Map.Entry<java.lang.String,AttributeValue> rangeKey) throws java.lang.IllegalArgumentException
This method accepts the hashKey, rangeKey of Key as
java.util.Map.Entry
hashKey
- Primary hash key.rangeKey
- Primary range key. (null if it a hash-only table)
java.lang.IllegalArgumentException
public GetItemRequest withKey(java.util.Map.Entry<java.lang.String,AttributeValue> hashKey, java.util.Map.Entry<java.lang.String,AttributeValue> rangeKey) throws java.lang.IllegalArgumentException
This method accepts the hashKey, rangeKey of Key as
java.util.Map.Entry
Returns a reference to this object so that method calls can be chained together.
hashKey
- Primary hash key.rangeKey
- Primary range key. (null if it a hash-only table)
java.lang.IllegalArgumentException
public GetItemRequest addKeyEntry(java.lang.String key, AttributeValue value)
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.
key
- The key of the entry to be added into Key.value
- The corresponding value of the entry to be added into Key.public GetItemRequest clearKeyEntries()
Returns a reference to this object so that method calls can be chained together.
public java.util.List<java.lang.String> getAttributesToGet()
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
Constraints:
Length: 1 -
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
public void setAttributesToGet(java.util.Collection<java.lang.String> attributesToGet)
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
Constraints:
Length: 1 -
attributesToGet
- The names of one or more attributes to retrieve. If no attribute names
are specified, then all attributes will be returned. If any of the
requested attributes are not found, they will not appear in the
result. Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
public GetItemRequest withAttributesToGet(java.lang.String... attributesToGet)
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 -
attributesToGet
- The names of one or more attributes to retrieve. If no attribute names
are specified, then all attributes will be returned. If any of the
requested attributes are not found, they will not appear in the
result. Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
public GetItemRequest withAttributesToGet(java.util.Collection<java.lang.String> attributesToGet)
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 -
attributesToGet
- The names of one or more attributes to retrieve. If no attribute names
are specified, then all attributes will be returned. If any of the
requested attributes are not found, they will not appear in the
result. Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
public java.lang.Boolean isConsistentRead()
true
, then the operation uses strongly
consistent reads; otherwise, eventually consistent reads are used.
true
, then the operation uses strongly
consistent reads; otherwise, eventually consistent reads are used.public void setConsistentRead(java.lang.Boolean consistentRead)
true
, then the operation uses strongly
consistent reads; otherwise, eventually consistent reads are used.
consistentRead
- If set to true
, then the operation uses strongly
consistent reads; otherwise, eventually consistent reads are used.public GetItemRequest withConsistentRead(java.lang.Boolean consistentRead)
true
, then the operation uses strongly
consistent reads; otherwise, eventually consistent reads are used.
Returns a reference to this object so that method calls can be chained together.
consistentRead
- If set to true
, then the operation uses strongly
consistent reads; otherwise, eventually consistent reads are used.
public java.lang.Boolean getConsistentRead()
true
, then the operation uses strongly
consistent reads; otherwise, eventually consistent reads are used.
true
, then the operation uses strongly
consistent reads; otherwise, eventually consistent reads are used.public java.lang.String getReturnConsumedCapacity()
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity
public void setReturnConsumedCapacity(java.lang.String returnConsumedCapacity)
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
returnConsumedCapacity
- If set to TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity
public GetItemRequest withReturnConsumedCapacity(java.lang.String returnConsumedCapacity)
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
returnConsumedCapacity
- If set to TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
ReturnConsumedCapacity
public void setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
returnConsumedCapacity
- If set to TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity
public GetItemRequest withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
returnConsumedCapacity
- If set to TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
ReturnConsumedCapacity
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |