public final class EnhancedClientUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
cleanAttributeName(String key)
There is a divergence in what constitutes an acceptable attribute name versus a token used in expression
names or values.
|
static <T> Key |
createKeyFromItem(T item,
TableSchema<T> tableSchema,
String indexName) |
static Key |
createKeyFromMap(Map<String,AttributeValue> itemMap,
TableSchema<?> tableSchema,
String indexName) |
static <T> List<T> |
getItemsFromSupplier(List<Supplier<T>> itemSupplierList) |
static boolean |
isNullAttributeValue(AttributeValue attributeValue)
A helper method to test if an
AttributeValue is a 'null' constant. |
static <ResponseT,ItemT> |
readAndTransformPaginatedItems(ResponseT response,
TableSchema<ItemT> tableSchema,
OperationContext operationContext,
DynamoDbEnhancedClientExtension dynamoDbEnhancedClientExtension,
Function<ResponseT,List<Map<String,AttributeValue>>> getItems,
Function<ResponseT,Map<String,AttributeValue>> getLastEvaluatedKey) |
static <T> T |
readAndTransformSingleItem(Map<String,AttributeValue> itemMap,
TableSchema<T> tableSchema,
OperationContext operationContext,
DynamoDbEnhancedClientExtension dynamoDbEnhancedClientExtension) |
public static String cleanAttributeName(String key)
key
- A key that may contain non alpha-numeric characters acceptable to a DynamoDb attribute name.public static <T> T readAndTransformSingleItem(Map<String,AttributeValue> itemMap, TableSchema<T> tableSchema, OperationContext operationContext, DynamoDbEnhancedClientExtension dynamoDbEnhancedClientExtension)
public static <ResponseT,ItemT> Page<ItemT> readAndTransformPaginatedItems(ResponseT response, TableSchema<ItemT> tableSchema, OperationContext operationContext, DynamoDbEnhancedClientExtension dynamoDbEnhancedClientExtension, Function<ResponseT,List<Map<String,AttributeValue>>> getItems, Function<ResponseT,Map<String,AttributeValue>> getLastEvaluatedKey)
public static <T> Key createKeyFromItem(T item, TableSchema<T> tableSchema, String indexName)
public static Key createKeyFromMap(Map<String,AttributeValue> itemMap, TableSchema<?> tableSchema, String indexName)
public static <T> List<T> getItemsFromSupplier(List<Supplier<T>> itemSupplierList)
public static boolean isNullAttributeValue(AttributeValue attributeValue)
AttributeValue
is a 'null' constant. This will not test if the
AttributeValue object is null itself, and in fact will throw a NullPointerException if you pass in null.attributeValue
- An AttributeValue
to test for null.Copyright © 2021. All rights reserved.