@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class GetItemRequest extends AmazonWebServiceRequest implements Serializable, Cloneable
Represents the input of a GetItem
operation.
NOOP
Constructor and Description |
---|
GetItemRequest()
Default constructor for GetItemRequest object.
|
GetItemRequest(String tableName,
Map<String,AttributeValue> key)
Constructs a new GetItemRequest object.
|
GetItemRequest(String tableName,
Map<String,AttributeValue> key,
Boolean consistentRead)
Constructs a new GetItemRequest object.
|
Modifier and Type | Method and Description |
---|---|
GetItemRequest |
addExpressionAttributeNamesEntry(String key,
String value)
Add a single ExpressionAttributeNames entry
|
GetItemRequest |
addKeyEntry(String key,
AttributeValue value)
Add a single Key entry
|
GetItemRequest |
clearExpressionAttributeNamesEntries()
Removes all the entries added into ExpressionAttributeNames.
|
GetItemRequest |
clearKeyEntries()
Removes all the entries added into Key.
|
GetItemRequest |
clone() |
boolean |
equals(Object obj) |
List<String> |
getAttributesToGet()
This is a legacy parameter.
|
Boolean |
getConsistentRead()
Determines the read consistency model: If set to
true , then the operation uses strongly consistent
reads; otherwise, the operation uses eventually consistent reads. |
Map<String,String> |
getExpressionAttributeNames()
One or more substitution tokens for attribute names in an expression.
|
Map<String,AttributeValue> |
getKey()
A map of attribute names to
AttributeValue objects, representing the primary key of the item to
retrieve. |
String |
getProjectionExpression()
A string that identifies one or more attributes to retrieve from the table.
|
String |
getReturnConsumedCapacity() |
String |
getTableName()
The name of the table containing the requested item.
|
int |
hashCode() |
Boolean |
isConsistentRead()
Determines the read consistency model: If set to
true , then the operation uses strongly consistent
reads; otherwise, the operation uses eventually consistent reads. |
void |
setAttributesToGet(Collection<String> attributesToGet)
This is a legacy parameter.
|
void |
setConsistentRead(Boolean consistentRead)
Determines the read consistency model: If set to
true , then the operation uses strongly consistent
reads; otherwise, the operation uses eventually consistent reads. |
void |
setExpressionAttributeNames(Map<String,String> expressionAttributeNames)
One or more substitution tokens for attribute names in an expression.
|
void |
setKey(Map.Entry<String,AttributeValue> hashKey,
Map.Entry<String,AttributeValue> rangeKey)
Set the hash and range key attributes of the item.
|
void |
setKey(Map<String,AttributeValue> key)
A map of attribute names to
AttributeValue objects, representing the primary key of the item to
retrieve. |
void |
setProjectionExpression(String projectionExpression)
A string that identifies one or more attributes to retrieve from the table.
|
void |
setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity) |
void |
setReturnConsumedCapacity(String returnConsumedCapacity) |
void |
setTableName(String tableName)
The name of the table containing the requested item.
|
String |
toString()
Returns a string representation of this object.
|
GetItemRequest |
withAttributesToGet(Collection<String> attributesToGet)
This is a legacy parameter.
|
GetItemRequest |
withAttributesToGet(String... attributesToGet)
This is a legacy parameter.
|
GetItemRequest |
withConsistentRead(Boolean consistentRead)
Determines the read consistency model: If set to
true , then the operation uses strongly consistent
reads; otherwise, the operation uses eventually consistent reads. |
GetItemRequest |
withExpressionAttributeNames(Map<String,String> expressionAttributeNames)
One or more substitution tokens for attribute names in an expression.
|
GetItemRequest |
withKey(Map.Entry<String,AttributeValue> hashKey,
Map.Entry<String,AttributeValue> rangeKey)
Set the hash and range key attributes of the item.
|
GetItemRequest |
withKey(Map<String,AttributeValue> key)
A map of attribute names to
AttributeValue objects, representing the primary key of the item to
retrieve. |
GetItemRequest |
withProjectionExpression(String projectionExpression)
A string that identifies one or more attributes to retrieve from the table.
|
GetItemRequest |
withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity) |
GetItemRequest |
withReturnConsumedCapacity(String returnConsumedCapacity) |
GetItemRequest |
withTableName(String tableName)
The name of the table containing the requested item.
|
addHandlerContext, copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getHandlerContext, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestCredentialsProvider, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
public GetItemRequest()
public GetItemRequest(String tableName, Map<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.
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
public GetItemRequest(String tableName, Map<String,AttributeValue> key, 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.
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
consistentRead
- Determines the read consistency model: If set to true
, then the operation uses strongly
consistent reads; otherwise, the operation uses eventually consistent reads.public void setTableName(String tableName)
The name of the table containing the requested item.
tableName
- The name of the table containing the requested item.public String getTableName()
The name of the table containing the requested item.
public GetItemRequest withTableName(String tableName)
The name of the table containing the requested item.
tableName
- The name of the table containing the requested item.public Map<String,AttributeValue> getKey()
A map of attribute names to AttributeValue
objects, representing the primary key of the item to
retrieve.
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
AttributeValue
objects, representing the primary key of the item
to retrieve.
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
public void setKey(Map<String,AttributeValue> key)
A map of attribute names to AttributeValue
objects, representing the primary key of the item to
retrieve.
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
key
- A map of attribute names to AttributeValue
objects, representing the primary key of the item
to retrieve.
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
public GetItemRequest withKey(Map<String,AttributeValue> key)
A map of attribute names to AttributeValue
objects, representing the primary key of the item to
retrieve.
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
key
- A map of attribute names to AttributeValue
objects, representing the primary key of the item
to retrieve.
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
public GetItemRequest addKeyEntry(String key, AttributeValue value)
public GetItemRequest clearKeyEntries()
public List<String> getAttributesToGet()
This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.
ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.public void setAttributesToGet(Collection<String> attributesToGet)
This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.
attributesToGet
- This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.public GetItemRequest withAttributesToGet(String... attributesToGet)
This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.
NOTE: This method appends the values to the existing list (if any). Use
setAttributesToGet(java.util.Collection)
or withAttributesToGet(java.util.Collection)
if you
want to override the existing values.
attributesToGet
- This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.public GetItemRequest withAttributesToGet(Collection<String> attributesToGet)
This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.
attributesToGet
- This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.public void setConsistentRead(Boolean consistentRead)
Determines the read consistency model: If set to true
, then the operation uses strongly consistent
reads; otherwise, the operation uses eventually consistent reads.
consistentRead
- Determines the read consistency model: If set to true
, then the operation uses strongly
consistent reads; otherwise, the operation uses eventually consistent reads.public Boolean getConsistentRead()
Determines the read consistency model: If set to true
, then the operation uses strongly consistent
reads; otherwise, the operation uses eventually consistent reads.
true
, then the operation uses strongly
consistent reads; otherwise, the operation uses eventually consistent reads.public GetItemRequest withConsistentRead(Boolean consistentRead)
Determines the read consistency model: If set to true
, then the operation uses strongly consistent
reads; otherwise, the operation uses eventually consistent reads.
consistentRead
- Determines the read consistency model: If set to true
, then the operation uses strongly
consistent reads; otherwise, the operation uses eventually consistent reads.public Boolean isConsistentRead()
Determines the read consistency model: If set to true
, then the operation uses strongly consistent
reads; otherwise, the operation uses eventually consistent reads.
true
, then the operation uses strongly
consistent reads; otherwise, the operation uses eventually consistent reads.public void setReturnConsumedCapacity(String returnConsumedCapacity)
returnConsumedCapacity
- ReturnConsumedCapacity
public String getReturnConsumedCapacity()
ReturnConsumedCapacity
public GetItemRequest withReturnConsumedCapacity(String returnConsumedCapacity)
returnConsumedCapacity
- ReturnConsumedCapacity
public void setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
returnConsumedCapacity
- ReturnConsumedCapacity
public GetItemRequest withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
returnConsumedCapacity
- ReturnConsumedCapacity
public void setProjectionExpression(String projectionExpression)
A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.
If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.
For more information, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
projectionExpression
- A string that identifies one or more attributes to retrieve from the table. These attributes can include
scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by
commas.
If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.
For more information, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
public String getProjectionExpression()
A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.
If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.
For more information, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.
For more information, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
public GetItemRequest withProjectionExpression(String projectionExpression)
A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.
If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.
For more information, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
projectionExpression
- A string that identifies one or more attributes to retrieve from the table. These attributes can include
scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by
commas.
If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.
For more information, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
public Map<String,String> getExpressionAttributeNames()
One or more substitution tokens for attribute names in an expression. The following are some use cases for using
ExpressionAttributeNames
:
To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For
the complete list of reserved words, see Reserved Words in
the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for
ExpressionAttributeNames
:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
ExpressionAttributeNames
:
To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an
expression. (For the complete list of reserved words, see Reserved
Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the
following for ExpressionAttributeNames
:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
public void setExpressionAttributeNames(Map<String,String> expressionAttributeNames)
One or more substitution tokens for attribute names in an expression. The following are some use cases for using
ExpressionAttributeNames
:
To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For
the complete list of reserved words, see Reserved Words in
the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for
ExpressionAttributeNames
:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
expressionAttributeNames
- One or more substitution tokens for attribute names in an expression. The following are some use cases for
using ExpressionAttributeNames
:
To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression.
(For the complete list of reserved words, see Reserved
Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the
following for ExpressionAttributeNames
:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
public GetItemRequest withExpressionAttributeNames(Map<String,String> expressionAttributeNames)
One or more substitution tokens for attribute names in an expression. The following are some use cases for using
ExpressionAttributeNames
:
To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For
the complete list of reserved words, see Reserved Words in
the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for
ExpressionAttributeNames
:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
expressionAttributeNames
- One or more substitution tokens for attribute names in an expression. The following are some use cases for
using ExpressionAttributeNames
:
To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression.
(For the complete list of reserved words, see Reserved
Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the
following for ExpressionAttributeNames
:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide.
public GetItemRequest addExpressionAttributeNamesEntry(String key, String value)
public GetItemRequest clearExpressionAttributeNamesEntries()
public void setKey(Map.Entry<String,AttributeValue> hashKey, Map.Entry<String,AttributeValue> rangeKey) throws IllegalArgumentException
For a hash-only table, you only need to provide the hash attribute. For a hash-and-range table, you must provide both.
hashKey
- a map entry including the name and value of the primary hash key.rangeKey
- a map entry including the name and value of the primary range key, or null if it is a hash-only table.IllegalArgumentException
public GetItemRequest withKey(Map.Entry<String,AttributeValue> hashKey, Map.Entry<String,AttributeValue> rangeKey) throws IllegalArgumentException
For a hash-only table, you only need to provide the hash attribute. For a hash-and-range table, you must provide both.
Returns a reference to this object so that method calls can be chained together.
hashKey
- a map entry including the name and value of the primary hash key.rangeKey
- a map entry including the name and value of the primary range key, or null if it is a hash-only table.IllegalArgumentException
public String toString()
toString
in class Object
Object.toString()
public GetItemRequest clone()
clone
in class AmazonWebServiceRequest
Copyright © 2022. All rights reserved.