Class AttributeValueConverter
java.lang.Object
dev.hogwai.dynamodb.simplified.internal.AttributeValueConverter
Converts Java objects to DynamoDB
AttributeValue.
Supports: null, String, Number, Boolean, byte[], List, Set (String/Number), and Map. Key-only operations (partition/sort keys) restrict to String, Number, and Binary.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull software.amazon.awssdk.services.dynamodb.model.AttributeValuetoAttributeValue(@Nullable Object value) Converts any supported Java type to an AttributeValue.static @NonNull software.amazon.awssdk.services.dynamodb.model.AttributeValuetoKeyAttributeValue(@Nullable Object value) Converts a partition key or sort key value to an AttributeValue.
-
Method Details
-
toAttributeValue
public static @NonNull software.amazon.awssdk.services.dynamodb.model.AttributeValue toAttributeValue(@Nullable Object value) Converts any supported Java type to an AttributeValue.- Parameters:
value- the value to convert (may benull)- Returns:
- the corresponding DynamoDB AttributeValue
-
toKeyAttributeValue
public static @NonNull software.amazon.awssdk.services.dynamodb.model.AttributeValue toKeyAttributeValue(@Nullable Object value) Converts a partition key or sort key value to an AttributeValue. DynamoDB keys allow only String, Number, and Binary.- Parameters:
value- the key value to convert- Returns:
- the corresponding DynamoDB AttributeValue
- Throws:
IllegalArgumentException- if the value isnullor an unsupported type
-