Class AttributeValue
- All Implemented Interfaces:
Serializable
,Cloneable
Represents the data for an attribute. You can set one, and only one, of the elements.
Each attribute in an item is a name-value pair. An attribute can be single-valued or multi-valued set. For example, a book item can have title and authors attributes. Each book has one title but can have many authors. The multi-valued attribute is a set; duplicate values are not allowed.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for AttributeValue object.Constructs a new AttributeValue object.AttributeValue
(List<String> sS) Constructs a new AttributeValue object. -
Method Summary
Modifier and TypeMethodDescriptionaddMEntry
(String key, AttributeValue value) Removes all the entries added into M.clone()
boolean
getB()
A Binary data type.getBOOL()
A Boolean data type.getBS()
A Binary Set data type.getL()
A List of attribute values.getM()
A Map of attribute values.getN()
A Number data type.getNS()
A Number Set data type.getNULL()
A Null data type.getS()
A String data type.getSS()
A String Set data type.int
hashCode()
isBOOL()
A Boolean data type.isNULL()
A Null data type.void
setB
(ByteBuffer b) A Binary data type.void
A Boolean data type.void
setBS
(Collection<ByteBuffer> bS) A Binary Set data type.void
A List of attribute values.void
setM
(Map<String, AttributeValue> m) A Map of attribute values.void
A Number data type.void
setNS
(Collection<String> nS) A Number Set data type.void
A Null data type.void
A String data type.void
setSS
(Collection<String> sS) A String Set data type.toString()
Returns a string representation of this object; useful for testing and debugging.withB
(ByteBuffer b) A Binary data type.A Boolean data type.withBS
(ByteBuffer... bS) A Binary Set data type.withBS
(Collection<ByteBuffer> bS) A Binary Set data type.withL
(AttributeValue... l) A List of attribute values.A List of attribute values.withM
(Map<String, AttributeValue> m) A Map of attribute values.A Number data type.A Number Set data type.withNS
(Collection<String> nS) A Number Set data type.A Null data type.A String data type.A String Set data type.withSS
(Collection<String> sS) A String Set data type.
-
Constructor Details
-
AttributeValue
public AttributeValue()Default constructor for AttributeValue object. Callers should use the setter or fluent setter (with...) methods to initialize the object after creating it. -
AttributeValue
Constructs a new AttributeValue object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.- Parameters:
s
- A String data type.
-
AttributeValue
Constructs a new AttributeValue object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.- Parameters:
sS
- A String Set data type.
-
-
Method Details
-
setS
A String data type.
- Parameters:
s
- A String data type.
-
getS
A String data type.
- Returns:
- A String data type.
-
withS
A String data type.
- Parameters:
s
- A String data type.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setN
A Number data type.
- Parameters:
n
- A Number data type.
-
getN
A Number data type.
- Returns:
- A Number data type.
-
withN
A Number data type.
- Parameters:
n
- A Number data type.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setB
A Binary data type.
AWS SDK for Java performs a Base64 encoding on this field before sending this request to AWS service by default. Users of the SDK should not perform Base64 encoding on this field.
Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future major version of the SDK.
- Parameters:
b
- A Binary data type.
-
getB
A Binary data type.
ByteBuffer
s are stateful. Calling theirget
methods changes theirposition
. We recommend usingByteBuffer.asReadOnlyBuffer()
to create a read-only view of the buffer with an independentposition
, and callingget
methods on this rather than directly on the returnedByteBuffer
. Doing so will ensure that anyone else using theByteBuffer
will not be affected by changes to theposition
.- Returns:
- A Binary data type.
-
withB
A Binary data type.
- Parameters:
b
- A Binary data type.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getSS
A String Set data type.
- Returns:
- A String Set data type.
-
setSS
A String Set data type.
- Parameters:
sS
- A String Set data type.
-
withSS
A String Set data type.
NOTE: This method appends the values to the existing list (if any). Use
setSS(java.util.Collection)
orwithSS(java.util.Collection)
if you want to override the existing values.- Parameters:
sS
- A String Set data type.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withSS
A String Set data type.
- Parameters:
sS
- A String Set data type.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getNS
A Number Set data type.
- Returns:
- A Number Set data type.
-
setNS
A Number Set data type.
- Parameters:
nS
- A Number Set data type.
-
withNS
A Number Set data type.
NOTE: This method appends the values to the existing list (if any). Use
setNS(java.util.Collection)
orwithNS(java.util.Collection)
if you want to override the existing values.- Parameters:
nS
- A Number Set data type.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withNS
A Number Set data type.
- Parameters:
nS
- A Number Set data type.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getBS
A Binary Set data type.
- Returns:
- A Binary Set data type.
-
setBS
A Binary Set data type.
- Parameters:
bS
- A Binary Set data type.
-
withBS
A Binary Set data type.
NOTE: This method appends the values to the existing list (if any). Use
setBS(java.util.Collection)
orwithBS(java.util.Collection)
if you want to override the existing values.- Parameters:
bS
- A Binary Set data type.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withBS
A Binary Set data type.
- Parameters:
bS
- A Binary Set data type.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getM
A Map of attribute values.
- Returns:
- A Map of attribute values.
-
setM
A Map of attribute values.
- Parameters:
m
- A Map of attribute values.
-
withM
A Map of attribute values.
- Parameters:
m
- A Map of attribute values.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
addMEntry
-
clearMEntries
Removes all the entries added into M. <p> Returns a reference to this object so that method calls can be chained together. -
getL
A List of attribute values.
- Returns:
- A List of attribute values.
-
setL
A List of attribute values.
- Parameters:
l
- A List of attribute values.
-
withL
A List of attribute values.
NOTE: This method appends the values to the existing list (if any). Use
setL(java.util.Collection)
orwithL(java.util.Collection)
if you want to override the existing values.- Parameters:
l
- A List of attribute values.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withL
A List of attribute values.
- Parameters:
l
- A List of attribute values.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setNULL
A Null data type.
- Parameters:
nULLValue
- A Null data type.
-
getNULL
A Null data type.
- Returns:
- A Null data type.
-
withNULL
A Null data type.
- Parameters:
nULLValue
- A Null data type.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
isNULL
A Null data type.
- Returns:
- A Null data type.
-
setBOOL
A Boolean data type.
- Parameters:
bOOL
- A Boolean data type.
-
getBOOL
A Boolean data type.
- Returns:
- A Boolean data type.
-
withBOOL
A Boolean data type.
- Parameters:
bOOL
- A Boolean data type.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
isBOOL
A Boolean data type.
- Returns:
- A Boolean data type.
-
toString
Returns a string representation of this object; useful for testing and debugging. -
equals
-
hashCode
public int hashCode() -
clone
-