public final class AttributeValues extends Object
AttributeValue
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.of(stringValue("id123"), numberValue(4.23));
Expression filterExpression = Expression.of("id = :filter_id", singletonMap(":filter_id", stringValue("id123"));
Modifier and Type | Method and Description |
---|---|
static AttributeValue |
binaryValue(ByteBuffer value)
Creates a literal binary
AttributeValue from a Java ByteBuffer . |
static boolean |
isNullAttributeValue(AttributeValue attributeValue)
A helper method to test if an
AttributeValue is a 'null' constant. |
static AttributeValue |
nullAttributeValue()
The constant that represents a 'null' in a DynamoDb record.
|
static AttributeValue |
numberValue(Number value)
Creates a literal numeric
AttributeValue from any type of Java number. |
static AttributeValue |
stringValue(String value)
Creates a literal string
AttributeValue . |
public static AttributeValue nullAttributeValue()
AttributeValue
of type NUL that represents 'null'.public static AttributeValue stringValue(String value)
AttributeValue
.value
- A string to create the literal from.AttributeValue
of type S that represents the string literal.public static AttributeValue numberValue(Number value)
AttributeValue
from any type of Java number.value
- A number to create the literal from.AttributeValue
of type n that represents the numeric literal.public static AttributeValue binaryValue(ByteBuffer value)
AttributeValue
from a Java ByteBuffer
.value
- A ByteBuffer
to create the literal from.AttributeValue
of type B that represents the binary literal.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 © 2019. All rights reserved.