Class QueryResponse
- java.lang.Object
-
- software.amazon.awssdk.core.SdkResponse
-
- software.amazon.awssdk.awscore.AwsResponse
-
- software.amazon.awssdk.services.dynamodb.model.DynamoDbResponse
-
- software.amazon.awssdk.services.dynamodb.model.QueryResponse
-
- All Implemented Interfaces:
SdkPojo,ToCopyableBuilder<QueryResponse.Builder,QueryResponse>
@Generated("software.amazon.awssdk:codegen") public final class QueryResponse extends DynamoDbResponse implements ToCopyableBuilder<QueryResponse.Builder,QueryResponse>
Represents the output of a
Queryoperation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceQueryResponse.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static QueryResponse.Builderbuilder()ConsumedCapacityconsumedCapacity()The capacity units consumed by theQueryoperation.Integercount()The number of items in the response.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)inthashCode()booleanhasItems()For responses, this returns true if the service returned a value for the Items property.booleanhasLastEvaluatedKey()For responses, this returns true if the service returned a value for the LastEvaluatedKey property.List<Map<String,AttributeValue>>items()An array of item attributes that match the query criteria.Map<String,AttributeValue>lastEvaluatedKey()The primary key of the item where the operation stopped, inclusive of the previous result set.IntegerscannedCount()The number of items evaluated, before anyQueryFilteris applied.Map<String,SdkField<?>>sdkFieldNameToField()List<SdkField<?>>sdkFields()static Class<? extends QueryResponse.Builder>serializableBuilderClass()QueryResponse.BuildertoBuilder()StringtoString()Returns a string representation of this object.-
Methods inherited from class software.amazon.awssdk.services.dynamodb.model.DynamoDbResponse
responseMetadata
-
Methods inherited from class software.amazon.awssdk.core.SdkResponse
sdkHttpResponse
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
hasItems
public final boolean hasItems()
For responses, this returns true if the service returned a value for the Items property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
items
public final List<Map<String,AttributeValue>> items()
An array of item attributes that match the query criteria. Each element in this array consists of an attribute name and the value for that attribute.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasItems()method.- Returns:
- An array of item attributes that match the query criteria. Each element in this array consists of an attribute name and the value for that attribute.
-
count
public final Integer count()
The number of items in the response.
If you used a
QueryFilterin the request, thenCountis the number of items returned after the filter was applied, andScannedCountis the number of matching items before the filter was applied.If you did not use a filter in the request, then
CountandScannedCountare the same.- Returns:
- The number of items in the response.
If you used a
QueryFilterin the request, thenCountis the number of items returned after the filter was applied, andScannedCountis the number of matching items before the filter was applied.If you did not use a filter in the request, then
CountandScannedCountare the same.
-
scannedCount
public final Integer scannedCount()
The number of items evaluated, before any
QueryFilteris applied. A highScannedCountvalue with few, or no,Countresults indicates an inefficientQueryoperation. For more information, see Count and ScannedCount in the Amazon DynamoDB Developer Guide.If you did not use a filter in the request, then
ScannedCountis the same asCount.- Returns:
- The number of items evaluated, before any
QueryFilteris applied. A highScannedCountvalue with few, or no,Countresults indicates an inefficientQueryoperation. For more information, see Count and ScannedCount in the Amazon DynamoDB Developer Guide.If you did not use a filter in the request, then
ScannedCountis the same asCount.
-
hasLastEvaluatedKey
public final boolean hasLastEvaluatedKey()
For responses, this returns true if the service returned a value for the LastEvaluatedKey property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
lastEvaluatedKey
public final Map<String,AttributeValue> lastEvaluatedKey()
The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.
If
LastEvaluatedKeyis empty, then the "last page" of results has been processed and there is no more data to be retrieved.If
LastEvaluatedKeyis not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is whenLastEvaluatedKeyis empty.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasLastEvaluatedKey()method.- Returns:
- The primary key of the item where the operation stopped, inclusive of the previous result set. Use this
value to start a new operation, excluding this value in the new request.
If
LastEvaluatedKeyis empty, then the "last page" of results has been processed and there is no more data to be retrieved.If
LastEvaluatedKeyis not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is whenLastEvaluatedKeyis empty.
-
consumedCapacity
public final ConsumedCapacity consumedCapacity()
The capacity units consumed by the
Queryoperation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation.ConsumedCapacityis only returned if theReturnConsumedCapacityparameter was specified. For more information, see Capacity unit consumption for read operations in the Amazon DynamoDB Developer Guide.- Returns:
- The capacity units consumed by the
Queryoperation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation.ConsumedCapacityis only returned if theReturnConsumedCapacityparameter was specified. For more information, see Capacity unit consumption for read operations in the Amazon DynamoDB Developer Guide.
-
toBuilder
public QueryResponse.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<QueryResponse.Builder,QueryResponse>- Specified by:
toBuilderin classAwsResponse
-
builder
public static QueryResponse.Builder builder()
-
serializableBuilderClass
public static Class<? extends QueryResponse.Builder> serializableBuilderClass()
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classAwsResponse
-
equals
public final boolean equals(Object obj)
- Overrides:
equalsin classAwsResponse
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
public final String toString()
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
-
getValueForField
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
- Overrides:
getValueForFieldin classSdkResponse
-
sdkFieldNameToField
public final Map<String,SdkField<?>> sdkFieldNameToField()
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-
-