Class EnhancedAttributeValue

    • Method Detail

      • nullValue

        public static EnhancedAttributeValue nullValue()
        Create an EnhancedAttributeValue for the null DynamoDB type.

        Equivalent to: EnhancedAttributeValue.fromGeneratedAttributeValue(AttributeValue.builder().nul(true).build())

        This call should never fail with an Exception.

      • fromNumber

        public static EnhancedAttributeValue fromNumber​(String numberValue)
        Create an EnhancedAttributeValue for a number (n) DynamoDB type.

        This is a String, because it matches the underlying DynamoDB representation.

        Equivalent to: EnhancedAttributeValue.fromGeneratedAttributeValue(AttributeValue.builder().n(...).build())

        This call will fail with a RuntimeException if the provided value is null. Use nullValue() for null values.

      • fromSetOfStrings

        public static EnhancedAttributeValue fromSetOfStrings​(String... setOfStringsValue)
        Create an EnhancedAttributeValue for a set-of-strings (ss) DynamoDB type.

        Equivalent to: EnhancedAttributeValue.fromGeneratedAttributeValue(AttributeValue.builder().ss(...).build())

        This call will fail with a RuntimeException if the provided value is null or contains a null value. Use fromListOfAttributeValues(List) for null values. This will not validate that there are no duplicate values.

      • fromSetOfNumbers

        public static EnhancedAttributeValue fromSetOfNumbers​(String... setOfNumbersValue)
        Create an EnhancedAttributeValue for a set-of-numbers (ns) DynamoDB type.

        Equivalent to: EnhancedAttributeValue.fromGeneratedAttributeValue(AttributeValue.builder().ns(...).build())

        This call will fail with a RuntimeException if the provided value is null or contains a null value. Use fromListOfAttributeValues(List) for null values. This will not validate that there are no duplicate values.

      • fromSetOfBytes

        public static EnhancedAttributeValue fromSetOfBytes​(SdkBytes... setOfBytesValue)
        Create an EnhancedAttributeValue for a set-of-bytes (bs) DynamoDB type.

        Equivalent to: EnhancedAttributeValue.fromGeneratedAttributeValue(AttributeValue.builder().bs(...).build())

        This call will fail with a RuntimeException if the provided value is null or contains a null value. Use fromListOfAttributeValues(List) for null values. This will not validate that there are no duplicate values.

      • fromListOfAttributeValues

        public static EnhancedAttributeValue fromListOfAttributeValues​(AttributeValue... listOfAttributeValuesValue)
        Create an EnhancedAttributeValue for a list-of-attributes (l) DynamoDB type.

        Equivalent to: EnhancedAttributeValue.fromGeneratedAttributeValue(AttributeValue.builder().l(...).build())

        This call will fail with a RuntimeException if the provided value is null or contains a null value. Use nullValue() for null values.

      • fromListOfAttributeValues

        public static EnhancedAttributeValue fromListOfAttributeValues​(List<AttributeValue> listOfAttributeValuesValue)
        Create an EnhancedAttributeValue for a list-of-attributes (l) DynamoDB type.

        Equivalent to: EnhancedAttributeValue.fromGeneratedAttributeValue(AttributeValue.builder().l(...).build())

        This call will fail with a RuntimeException if the provided value is null or contains a null value. Use nullValue() for null values.

      • type

        public AttributeValueType type()
        Retrieve the underlying DynamoDB type of this value, such as String (s) or Number (n).

        This call should never fail with an Exception.

      • convert

        public <T> T convert​(TypeConvertingVisitor<T> convertingVisitor)
        Apply the provided visitor to this item attribute value, converting it into a specific type. This is useful in AttributeConverter implementations, without having to write a switch statement on the type().

        Reasons this call may fail with a RuntimeException:

        1. If the provided visitor is null.
        2. If the value cannot be converted by this visitor.
      • isMap

        public boolean isMap()
        Returns true if the underlying DynamoDB type of this value is a Map (m).

        This call should never fail with an Exception.

      • isString

        public boolean isString()
        Returns true if the underlying DynamoDB type of this value is a String (s).

        This call should never fail with an Exception.

      • isNumber

        public boolean isNumber()
        Returns true if the underlying DynamoDB type of this value is a Number (n).

        This call should never fail with an Exception.

      • isBytes

        public boolean isBytes()
        Returns true if the underlying DynamoDB type of this value is Bytes (b).

        This call should never fail with an Exception.

      • isBoolean

        public boolean isBoolean()
        Returns true if the underlying DynamoDB type of this value is a Boolean (bool).

        This call should never fail with an Exception.

      • isSetOfStrings

        public boolean isSetOfStrings()
        Returns true if the underlying DynamoDB type of this value is a Set of Strings (ss).

        This call should never fail with an Exception.

      • isSetOfNumbers

        public boolean isSetOfNumbers()
        Returns true if the underlying DynamoDB type of this value is a Set of Numbers (ns).

        This call should never fail with an Exception.

      • isSetOfBytes

        public boolean isSetOfBytes()
        Returns true if the underlying DynamoDB type of this value is a Set of Bytes (bs).

        This call should never fail with an Exception.

      • isListOfAttributeValues

        public boolean isListOfAttributeValues()
        Returns true if the underlying DynamoDB type of this value is a List of AttributeValues (l).

        This call should never fail with an Exception.

      • isNull

        public boolean isNull()
        Returns true if the underlying DynamoDB type of this value is Null (null).

        This call should never fail with an Exception.

      • asNumber

        public String asNumber()
        Retrieve this value as a number. Note: This returns a String (instead of a Number), because that's the generated type from DynamoDB: AttributeValue.n().

        This call will fail with a RuntimeException if isNumber() is false.

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object