Class Index<T>
java.lang.Object
dev.hogwai.dynamodb.simplified.builder.Index<T>
- Type Parameters:
T- the item type
Typed wrapper for a DynamoDB secondary index (GSI or LSI).
Obtained via table.index("indexName"). Provides fluent query and scan
builders scoped to this index.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newIndexwrapping the givenDynamoDbIndex.Index(@NonNull software.amazon.awssdk.enhanced.dynamodb.DynamoDbIndex<T> dynamoDbIndex, @Nullable software.amazon.awssdk.services.dynamodb.DynamoDbClient dynamoDbClient) Constructs a newIndexwrapping the givenDynamoDbIndexwith a low-level client. -
Method Summary
Modifier and TypeMethodDescription@NonNull software.amazon.awssdk.enhanced.dynamodb.DynamoDbIndex<T> Returns the underlyingDynamoDbIndex.@NonNull StringReturns the name of this index.@NonNull QueryBuilder<T> query()Starts building a query operation on this index.@NonNull ScanBuilder<T> scan()Starts building a scan operation on this index.@NonNull StringReturns the name of the table this index belongs to.
-
Constructor Details
-
Index
Constructs a newIndexwrapping the givenDynamoDbIndex.- Parameters:
dynamoDbIndex- the DynamoDB index to wrap
-
Index
public Index(@NonNull software.amazon.awssdk.enhanced.dynamodb.DynamoDbIndex<T> dynamoDbIndex, @Nullable software.amazon.awssdk.services.dynamodb.DynamoDbClient dynamoDbClient) Constructs a newIndexwrapping the givenDynamoDbIndexwith a low-level client.- Parameters:
dynamoDbIndex- the DynamoDB index to wrapdynamoDbClient- the low-level DynamoDB client (nullable)
-
-
Method Details
-
getRawIndex
Returns the underlyingDynamoDbIndex.- Returns:
- the raw DynamoDB index
-
indexName
-
tableName
Returns the name of the table this index belongs to.- Returns:
- the table name
-
query
Starts building a query operation on this index.- Returns:
- a query builder pre-configured for this index
-
scan
Starts building a scan operation on this index.- Returns:
- a scan builder pre-configured for this index
-