/* * Copyright 2018-2023 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; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** *
* Represents the input of a GetItem
operation.
*
* The name of the table containing the requested item. *
*/ private String tableName; /** *
* 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. *
*/ private java.util.Map
* This is a legacy parameter. Use ProjectionExpression
instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide.
*
* Determines the read consistency model: If set to true
, then the operation uses strongly consistent
* reads; otherwise, the operation uses eventually consistent reads.
*
* 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. *
*/ private String projectionExpression; /** *
* 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. *
*/ private java.util.MapAttributeValue
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, java.util.MapAttributeValue
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.
* @param consistentRead
* Determines the read consistency model: If set to
* The name of the table containing the requested item.
*
* The name of the table containing the requested item.
*
* The name of the table containing the requested item.
*
* A map of attribute names to
* 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.
* true
, then the operation uses strongly
* consistent reads; otherwise, the operation uses eventually consistent reads.
*/
public GetItemRequest(String tableName, java.util.MapAttributeValue
objects, representing the primary key of the item to
* retrieve.
* 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 java.util.Map
* A map of attribute names to
* 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.
* 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(java.util.Map
* A map of attribute names to
* 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.
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetItemRequest withKey(java.util.Map
* This is a legacy parameter. Use
* This is a legacy parameter. Use
* This is a legacy parameter. Use
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAttributesToGet(java.util.Collection)} or {@link #withAttributesToGet(java.util.Collection)} if you
* want to override the existing values.
*
* This is a legacy parameter. Use
* Determines the read consistency model: If set to
* Determines the read consistency model: If set to
* Determines the read consistency model: If set to
* Determines the read consistency model: If set to
* 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
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 java.util.ListProjectionExpression
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(java.util.CollectionProjectionExpression
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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetItemRequest withAttributesToGet(String... attributesToGet) {
if (this.attributesToGet == null) {
setAttributesToGet(new java.util.ArrayListProjectionExpression
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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetItemRequest withAttributesToGet(java.util.Collectiontrue
, 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 setConsistentRead(Boolean consistentRead) {
this.consistentRead = consistentRead;
}
/**
* 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 Boolean getConsistentRead() {
return this.consistentRead;
}
/**
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetItemRequest withConsistentRead(Boolean consistentRead) {
setConsistentRead(consistentRead);
return this;
}
/**
* 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 Boolean isConsistentRead() {
return this.consistentRead;
}
/**
* @param returnConsumedCapacity
* @see ReturnConsumedCapacity
*/
public void setReturnConsumedCapacity(String returnConsumedCapacity) {
this.returnConsumedCapacity = returnConsumedCapacity;
}
/**
* @return
* @see ReturnConsumedCapacity
*/
public String getReturnConsumedCapacity() {
return this.returnConsumedCapacity;
}
/**
* @param returnConsumedCapacity
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReturnConsumedCapacity
*/
public GetItemRequest withReturnConsumedCapacity(String returnConsumedCapacity) {
setReturnConsumedCapacity(returnConsumedCapacity);
return this;
}
/**
* @param returnConsumedCapacity
* @see ReturnConsumedCapacity
*/
public void setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity) {
withReturnConsumedCapacity(returnConsumedCapacity);
}
/**
* @param returnConsumedCapacity
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReturnConsumedCapacity
*/
public GetItemRequest withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity) {
this.returnConsumedCapacity = returnConsumedCapacity.toString();
return this;
}
/**
*
* 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 void setProjectionExpression(String projectionExpression) { this.projectionExpression = 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. *
* * @return 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() { return this.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. *
* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ public GetItemRequest withProjectionExpression(String projectionExpression) { setProjectionExpression(projectionExpression); return this; } /** *
* 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. *
* * @return One or more substitution tokens for attribute names in an expression. The following are some use cases * for usingExpressionAttributeNames
:
* * 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 java.util.Map
* One or more substitution tokens for attribute names in an expression. The following are some use cases for using
*
* 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:
*
*
* 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
*
*
* You could then use this substitution in an expression, as in this example:
*
*
* 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
:
*
*
*
*
* Percentile
* ExpressionAttributeNames
:
*
*
* {"#P":"Percentile"}
*
*
* #P = :val
* 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(java.util.Map
* One or more substitution tokens for attribute names in an expression. The following are some use cases for using
*
* 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:
*
*
* 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
*
*
* You could then use this substitution in an expression, as in this example:
*
*
* 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
:
*
*
*
*
* Percentile
* ExpressionAttributeNames
:
*
*
* {"#P":"Percentile"}
*
*
* #P = :val
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetItemRequest withExpressionAttributeNames(java.util.Map
* For a hash-only table, you only need to provide the hash attribute. For a hash-and-range table, you must provide
* both.
*
* @param hashKey
* a map entry including the name and value of the primary hash key.
* @param rangeKey
* a map entry including the name and value of the primary range key, or null if it is a hash-only table.
*/
public void setKey(java.util.Map.Entry
* 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.
*
* @param hashKey
* a map entry including the name and value of the primary hash key.
* @param rangeKey
* a map entry including the name and value of the primary range key, or null if it is a hash-only table.
*/
public GetItemRequest withKey(java.util.Map.Entry