@Generated(value="software.amazon.awssdk:codegen") public final class AttributeValue extends Object implements SdkPojo, Serializable, ToCopyableBuilder<AttributeValue.Builder,AttributeValue>
Represents the data for an attribute.
Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.
For more information, see Data Types in the Amazon DynamoDB Developer Guide.
Modifier and Type | Class and Description |
---|---|
static interface |
AttributeValue.Builder |
static class |
AttributeValue.Type |
Modifier and Type | Method and Description |
---|---|
SdkBytes |
b()
An attribute of type Binary.
|
Boolean |
bool()
An attribute of type Boolean.
|
List<SdkBytes> |
bs()
An attribute of type Binary Set.
|
static AttributeValue.Builder |
builder() |
boolean |
equals(Object obj) |
boolean |
equalsBySdkFields(Object obj) |
static AttributeValue |
fromB(SdkBytes b)
Create an instance of this class with
b() initialized to the given value. |
static AttributeValue |
fromBool(Boolean bool)
Create an instance of this class with
bool() initialized to the given value. |
static AttributeValue |
fromBs(List<SdkBytes> bs)
Create an instance of this class with
bs() initialized to the given value. |
static AttributeValue |
fromL(List<AttributeValue> l)
Create an instance of this class with
l() initialized to the given value. |
static AttributeValue |
fromM(Map<String,AttributeValue> m)
Create an instance of this class with
m() initialized to the given value. |
static AttributeValue |
fromN(String n)
Create an instance of this class with
n() initialized to the given value. |
static AttributeValue |
fromNs(List<String> ns)
Create an instance of this class with
ns() initialized to the given value. |
static AttributeValue |
fromNul(Boolean nul)
Create an instance of this class with
nul() initialized to the given value. |
static AttributeValue |
fromS(String s)
Create an instance of this class with
s() initialized to the given value. |
static AttributeValue |
fromSs(List<String> ss)
Create an instance of this class with
ss() initialized to the given value. |
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz) |
boolean |
hasBs()
For responses, this returns true if the service returned a value for the BS property.
|
int |
hashCode() |
boolean |
hasL()
For responses, this returns true if the service returned a value for the L property.
|
boolean |
hasM()
For responses, this returns true if the service returned a value for the M property.
|
boolean |
hasNs()
For responses, this returns true if the service returned a value for the NS property.
|
boolean |
hasSs()
For responses, this returns true if the service returned a value for the SS property.
|
List<AttributeValue> |
l()
An attribute of type List.
|
Map<String,AttributeValue> |
m()
An attribute of type Map.
|
String |
n()
An attribute of type Number.
|
List<String> |
ns()
An attribute of type Number Set.
|
Boolean |
nul()
An attribute of type Null.
|
String |
s()
An attribute of type String.
|
List<SdkField<?>> |
sdkFields() |
static Class<? extends AttributeValue.Builder> |
serializableBuilderClass() |
List<String> |
ss()
An attribute of type String Set.
|
AttributeValue.Builder |
toBuilder() |
String |
toString()
Returns a string representation of this object.
|
AttributeValue.Type |
type()
Retrieve an enum value representing which member of this object is populated.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
copy
public final String s()
An attribute of type String. For example:
"S": "Hello"
"S": "Hello"
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.
"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.
public final SdkBytes b()
An attribute of type Binary. For example:
"B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
"B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
public final boolean hasSs()
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.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.
"SS": ["Giraffe", "Hippo" ,"Zebra"]
public final boolean hasNs()
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.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.
"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.
public final boolean hasBs()
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.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.
"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
public final boolean hasM()
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.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.
"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
public final boolean hasL()
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.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.
"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N": "3.14159"}]
public final Boolean bool()
An attribute of type Boolean. For example:
"BOOL": true
"BOOL": true
public final Boolean nul()
An attribute of type Null. For example:
"NULL": true
"NULL": true
public AttributeValue.Builder toBuilder()
toBuilder
in interface ToCopyableBuilder<AttributeValue.Builder,AttributeValue>
public static AttributeValue.Builder builder()
public static Class<? extends AttributeValue.Builder> serializableBuilderClass()
public final boolean equalsBySdkFields(Object obj)
equalsBySdkFields
in interface SdkPojo
public final String toString()
public static AttributeValue fromS(String s)
s()
initialized to the given value.
An attribute of type String. For example:
"S": "Hello"
s
- An attribute of type String. For example:
"S": "Hello"
public static AttributeValue fromN(String n)
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.
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.
public static AttributeValue fromB(SdkBytes b)
b()
initialized to the given value.
An attribute of type Binary. For example:
"B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
b
- An attribute of type Binary. For example:
"B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
public static AttributeValue fromSs(List<String> ss)
ss()
initialized to the given value.
An attribute of type String Set. For example:
"SS": ["Giraffe", "Hippo" ,"Zebra"]
ss
- An attribute of type String Set. For example:
"SS": ["Giraffe", "Hippo" ,"Zebra"]
public static AttributeValue fromNs(List<String> ns)
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.
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.
public static AttributeValue fromBs(List<SdkBytes> bs)
bs()
initialized to the given value.
An attribute of type Binary Set. For example:
"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
bs
- An attribute of type Binary Set. For example:
"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
public static AttributeValue fromM(Map<String,AttributeValue> m)
m()
initialized to the given value.
An attribute of type Map. For example:
"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
m
- An attribute of type Map. For example:
"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
public static AttributeValue fromL(List<AttributeValue> l)
l()
initialized to the given value.
An attribute of type List. For example:
"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N": "3.14159"}]
l
- An attribute of type List. For example:
"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N": "3.14159"}]
public static AttributeValue fromBool(Boolean bool)
bool()
initialized to the given value.
An attribute of type Boolean. For example:
"BOOL": true
bool
- An attribute of type Boolean. For example:
"BOOL": true
public static AttributeValue fromNul(Boolean nul)
nul()
initialized to the given value.
An attribute of type Null. For example:
"NULL": true
nul
- An attribute of type Null. For example:
"NULL": true
public AttributeValue.Type type()
AttributeValue.Type.UNKNOWN_TO_SDK_VERSION
if the
service returned a member that is only known to a newer SDK version.
When this class is created directly in your code, this will be AttributeValue.Type.UNKNOWN_TO_SDK_VERSION
if zero
members are set, and null
if more than one member is set.Copyright © 2023. All rights reserved.