Class AttributeValues
- java.lang.Object
-
- software.amazon.awssdk.enhanced.dynamodb.internal.AttributeValues
-
public final class AttributeValues extends Object
This static helper class contains some literalAttributeValue
constants and converters. Primarily these will be used if constructing a literal key object or for use in a custom filter expression. Eg:Key<?> myKey = Key.create(stringValue("id123"), numberValue(4.23)); Expression filterExpression = Expression.of("id = :filter_id", singletonMap(":filter_id", stringValue("id123"));
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AttributeValue
binaryValue(SdkBytes value)
Creates a literal binaryAttributeValue
from raw bytes.static AttributeValue
nullAttributeValue()
The constant that represents a 'null' in a DynamoDb record.static AttributeValue
numberValue(Number value)
Creates a literal numericAttributeValue
from any type of Java number.static AttributeValue
stringValue(String value)
Creates a literal stringAttributeValue
.
-
-
-
Method Detail
-
nullAttributeValue
public static AttributeValue nullAttributeValue()
The constant that represents a 'null' in a DynamoDb record.- Returns:
- An
AttributeValue
of type NUL that represents 'null'.
-
stringValue
public static AttributeValue stringValue(String value)
Creates a literal stringAttributeValue
.- Parameters:
value
- A string to create the literal from.- Returns:
- An
AttributeValue
of type S that represents the string literal.
-
numberValue
public static AttributeValue numberValue(Number value)
Creates a literal numericAttributeValue
from any type of Java number.- Parameters:
value
- A number to create the literal from.- Returns:
- An
AttributeValue
of type n that represents the numeric literal.
-
binaryValue
public static AttributeValue binaryValue(SdkBytes value)
Creates a literal binaryAttributeValue
from raw bytes.- Parameters:
value
- bytes to create the literal from.- Returns:
- An
AttributeValue
of type B that represents the binary literal.
-
-