Class AttributeValue

    • Method Detail

      • s

        public final String s()

        An attribute of type String. For example:

        "S": "Hello"

        Returns:
        An attribute of type String. For example:

        "S": "Hello"

      • n

        public final String n()

        An attribute of type Number. For example:

        "N": "123.45"

        Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.

        Returns:
        An attribute of type Number. For example:

        "N": "123.45"

        Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.

      • b

        public final SdkBytes b()

        An attribute of type Binary. For example:

        "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"

        Returns:
        An attribute of type Binary. For example:

        "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"

      • hasSs

        public final boolean hasSs()
        For responses, this returns true if the service returned a value for the SS property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
      • ss

        public final List<String> ss()

        An attribute of type String Set. For example:

        "SS": ["Giraffe", "Hippo" ,"Zebra"]

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasSs() method.

        Returns:
        An attribute of type String Set. For example:

        "SS": ["Giraffe", "Hippo" ,"Zebra"]

      • hasNs

        public final boolean hasNs()
        For responses, this returns true if the service returned a value for the NS property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
      • ns

        public final List<String> ns()

        An attribute of type Number Set. For example:

        "NS": ["42.2", "-19", "7.5", "3.14"]

        Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasNs() method.

        Returns:
        An attribute of type Number Set. For example:

        "NS": ["42.2", "-19", "7.5", "3.14"]

        Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.

      • hasBs

        public final boolean hasBs()
        For responses, this returns true if the service returned a value for the BS property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
      • bs

        public final List<SdkBytes> bs()

        An attribute of type Binary Set. For example:

        "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasBs() method.

        Returns:
        An attribute of type Binary Set. For example:

        "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]

      • hasM

        public final boolean hasM()
        For responses, this returns true if the service returned a value for the M property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
      • m

        public final Map<String,​AttributeValue> m()

        An attribute of type Map. For example:

        "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasM() method.

        Returns:
        An attribute of type Map. For example:

        "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}

      • hasL

        public final boolean hasL()
        For responses, this returns true if the service returned a value for the L property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
      • l

        public final List<AttributeValue> l()

        An attribute of type List. For example:

        "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N": "3.14159"}]

        Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

        This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasL() method.

        Returns:
        An attribute of type List. For example:

        "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N": "3.14159"}]

      • bool

        public final Boolean bool()

        An attribute of type Boolean. For example:

        "BOOL": true

        Returns:
        An attribute of type Boolean. For example:

        "BOOL": true

      • nul

        public final Boolean nul()

        An attribute of type Null. For example:

        "NULL": true

        Returns:
        An attribute of type Null. For example:

        "NULL": true

      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public final String toString()
        Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
        Overrides:
        toString in class Object
      • getValueForField

        public final <T> Optional<T> getValueForField​(String fieldName,
                                                      Class<T> clazz)
      • fromS

        public static AttributeValue fromS​(String s)
        Create an instance of this class with s() initialized to the given value.

        An attribute of type String. For example:

        "S": "Hello"

        Parameters:
        s - An attribute of type String. For example:

        "S": "Hello"

      • fromN

        public static AttributeValue fromN​(String n)
        Create an instance of this class with n() initialized to the given value.

        An attribute of type Number. For example:

        "N": "123.45"

        Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.

        Parameters:
        n - An attribute of type Number. For example:

        "N": "123.45"

        Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.

      • fromB

        public static AttributeValue fromB​(SdkBytes b)
        Create an instance of this class with b() initialized to the given value.

        An attribute of type Binary. For example:

        "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"

        Parameters:
        b - An attribute of type Binary. For example:

        "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"

      • fromSs

        public static AttributeValue fromSs​(List<String> ss)
        Create an instance of this class with ss() initialized to the given value.

        An attribute of type String Set. For example:

        "SS": ["Giraffe", "Hippo" ,"Zebra"]

        Parameters:
        ss - An attribute of type String Set. For example:

        "SS": ["Giraffe", "Hippo" ,"Zebra"]

      • fromNs

        public static AttributeValue fromNs​(List<String> ns)
        Create an instance of this class with ns() initialized to the given value.

        An attribute of type Number Set. For example:

        "NS": ["42.2", "-19", "7.5", "3.14"]

        Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.

        Parameters:
        ns - An attribute of type Number Set. For example:

        "NS": ["42.2", "-19", "7.5", "3.14"]

        Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.

      • fromBs

        public static AttributeValue fromBs​(List<SdkBytes> bs)
        Create an instance of this class with bs() initialized to the given value.

        An attribute of type Binary Set. For example:

        "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]

        Parameters:
        bs - An attribute of type Binary Set. For example:

        "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]

      • fromM

        public static AttributeValue fromM​(Map<String,​AttributeValue> m)
        Create an instance of this class with m() initialized to the given value.

        An attribute of type Map. For example:

        "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}

        Parameters:
        m - An attribute of type Map. For example:

        "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}

      • fromL

        public static AttributeValue fromL​(List<AttributeValue> l)
        Create an instance of this class with l() initialized to the given value.

        An attribute of type List. For example:

        "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N": "3.14159"}]

        Parameters:
        l - An attribute of type List. For example:

        "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N": "3.14159"}]

      • fromBool

        public static AttributeValue fromBool​(Boolean bool)
        Create an instance of this class with bool() initialized to the given value.

        An attribute of type Boolean. For example:

        "BOOL": true

        Parameters:
        bool - An attribute of type Boolean. For example:

        "BOOL": true

      • fromNul

        public static AttributeValue fromNul​(Boolean nul)
        Create an instance of this class with nul() initialized to the given value.

        An attribute of type Null. For example:

        "NULL": true

        Parameters:
        nul - An attribute of type Null. For example:

        "NULL": true