Class AttributeValues


  • public final class AttributeValues
    extends Object
    This static helper class contains some literal 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.create(stringValue("id123"), numberValue(4.23)); Expression filterExpression = Expression.of("id = :filter_id", singletonMap(":filter_id", stringValue("id123"));
    • 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 string AttributeValue.
        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 numeric AttributeValue 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 binary AttributeValue from raw bytes.
        Parameters:
        value - bytes to create the literal from.
        Returns:
        An AttributeValue of type B that represents the binary literal.