public class AttributeValue
extends java.lang.Object
implements java.io.Serializable, java.lang.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.
Modifier and Type | Field and Description |
---|---|
private java.nio.ByteBuffer |
b
A Binary data type.
|
private java.lang.Boolean |
bOOL
A Boolean data type.
|
private java.util.List<java.nio.ByteBuffer> |
bS
A Binary Set data type.
|
private java.util.List<AttributeValue> |
l
A List of attribute values.
|
private java.util.Map<java.lang.String,AttributeValue> |
m
A Map of attribute values.
|
private java.lang.String |
n
A Number data type.
|
private java.util.List<java.lang.String> |
nS
A Number Set data type.
|
private java.lang.Boolean |
nULLValue
A Null data type.
|
private java.lang.String |
s
A String data type.
|
private java.util.List<java.lang.String> |
sS
A String Set data type.
|
Constructor and Description |
---|
AttributeValue()
Default constructor for AttributeValue object.
|
AttributeValue(java.util.List<java.lang.String> sS)
Constructs a new AttributeValue object.
|
AttributeValue(java.lang.String s)
Constructs a new AttributeValue object.
|
Modifier and Type | Method and Description |
---|---|
AttributeValue |
addMEntry(java.lang.String key,
AttributeValue value) |
AttributeValue |
clearMEntries()
Removes all the entries added into M.
|
AttributeValue |
clone() |
boolean |
equals(java.lang.Object obj) |
java.nio.ByteBuffer |
getB()
A Binary data type.
|
java.lang.Boolean |
getBOOL()
A Boolean data type.
|
java.util.List<java.nio.ByteBuffer> |
getBS()
A Binary Set data type.
|
java.util.List<AttributeValue> |
getL()
A List of attribute values.
|
java.util.Map<java.lang.String,AttributeValue> |
getM()
A Map of attribute values.
|
java.lang.String |
getN()
A Number data type.
|
java.util.List<java.lang.String> |
getNS()
A Number Set data type.
|
java.lang.Boolean |
getNULL()
A Null data type.
|
java.lang.String |
getS()
A String data type.
|
java.util.List<java.lang.String> |
getSS()
A String Set data type.
|
int |
hashCode() |
java.lang.Boolean |
isBOOL()
A Boolean data type.
|
java.lang.Boolean |
isNULL()
A Null data type.
|
void |
setB(java.nio.ByteBuffer b)
A Binary data type.
|
void |
setBOOL(java.lang.Boolean bOOL)
A Boolean data type.
|
void |
setBS(java.util.Collection<java.nio.ByteBuffer> bS)
A Binary Set data type.
|
void |
setL(java.util.Collection<AttributeValue> l)
A List of attribute values.
|
void |
setM(java.util.Map<java.lang.String,AttributeValue> m)
A Map of attribute values.
|
void |
setN(java.lang.String n)
A Number data type.
|
void |
setNS(java.util.Collection<java.lang.String> nS)
A Number Set data type.
|
void |
setNULL(java.lang.Boolean nULLValue)
A Null data type.
|
void |
setS(java.lang.String s)
A String data type.
|
void |
setSS(java.util.Collection<java.lang.String> sS)
A String Set data type.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
AttributeValue |
withB(java.nio.ByteBuffer b)
A Binary data type.
|
AttributeValue |
withBOOL(java.lang.Boolean bOOL)
A Boolean data type.
|
AttributeValue |
withBS(java.nio.ByteBuffer... bS)
A Binary Set data type.
|
AttributeValue |
withBS(java.util.Collection<java.nio.ByteBuffer> bS)
A Binary Set data type.
|
AttributeValue |
withL(AttributeValue... l)
A List of attribute values.
|
AttributeValue |
withL(java.util.Collection<AttributeValue> l)
A List of attribute values.
|
AttributeValue |
withM(java.util.Map<java.lang.String,AttributeValue> m)
A Map of attribute values.
|
AttributeValue |
withN(java.lang.String n)
A Number data type.
|
AttributeValue |
withNS(java.util.Collection<java.lang.String> nS)
A Number Set data type.
|
AttributeValue |
withNS(java.lang.String... nS)
A Number Set data type.
|
AttributeValue |
withNULL(java.lang.Boolean nULLValue)
A Null data type.
|
AttributeValue |
withS(java.lang.String s)
A String data type.
|
AttributeValue |
withSS(java.util.Collection<java.lang.String> sS)
A String Set data type.
|
AttributeValue |
withSS(java.lang.String... sS)
A String Set data type.
|
private java.lang.String s
A String data type.
private java.lang.String n
A Number data type.
private java.nio.ByteBuffer b
A Binary data type.
private java.util.List<java.lang.String> sS
A String Set data type.
private java.util.List<java.lang.String> nS
A Number Set data type.
private java.util.List<java.nio.ByteBuffer> bS
A Binary Set data type.
private java.util.Map<java.lang.String,AttributeValue> m
A Map of attribute values.
private java.util.List<AttributeValue> l
A List of attribute values.
private java.lang.Boolean nULLValue
A Null data type.
private java.lang.Boolean bOOL
A Boolean data type.
public AttributeValue()
public AttributeValue(java.lang.String s)
s
- A String data type.public AttributeValue(java.util.List<java.lang.String> sS)
sS
- A String Set data type.public void setS(java.lang.String s)
A String data type.
s
- A String data type.public java.lang.String getS()
A String data type.
public AttributeValue withS(java.lang.String s)
A String data type.
s
- A String data type.public void setN(java.lang.String n)
A Number data type.
n
- A Number data type.public java.lang.String getN()
A Number data type.
public AttributeValue withN(java.lang.String n)
A Number data type.
n
- A Number data type.public void setB(java.nio.ByteBuffer b)
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.
b
- A Binary data type.public java.nio.ByteBuffer getB()
A Binary data type.
ByteBuffer
s are stateful. Calling their get
methods
changes their position
. We recommend using
ByteBuffer.asReadOnlyBuffer()
to create a read-only view
of the buffer with an independent position
, and calling
get
methods on this rather than directly on the returned
ByteBuffer
. Doing so will ensure that anyone else using the
ByteBuffer
will not be affected by changes to the position
.
public AttributeValue withB(java.nio.ByteBuffer b)
A Binary data type.
b
- A Binary data type.public java.util.List<java.lang.String> getSS()
A String Set data type.
public void setSS(java.util.Collection<java.lang.String> sS)
A String Set data type.
sS
- A String Set data type.public AttributeValue withSS(java.lang.String... sS)
A String Set data type.
NOTE: This method appends the values to the existing list (if
any). Use setSS(java.util.Collection)
or
withSS(java.util.Collection)
if you want to override the
existing values.
sS
- A String Set data type.public AttributeValue withSS(java.util.Collection<java.lang.String> sS)
A String Set data type.
sS
- A String Set data type.public java.util.List<java.lang.String> getNS()
A Number Set data type.
public void setNS(java.util.Collection<java.lang.String> nS)
A Number Set data type.
nS
- A Number Set data type.public AttributeValue withNS(java.lang.String... nS)
A Number Set data type.
NOTE: This method appends the values to the existing list (if
any). Use setNS(java.util.Collection)
or
withNS(java.util.Collection)
if you want to override the
existing values.
nS
- A Number Set data type.public AttributeValue withNS(java.util.Collection<java.lang.String> nS)
A Number Set data type.
nS
- A Number Set data type.public java.util.List<java.nio.ByteBuffer> getBS()
A Binary Set data type.
public void setBS(java.util.Collection<java.nio.ByteBuffer> bS)
A Binary Set data type.
bS
- A Binary Set data type.public AttributeValue withBS(java.nio.ByteBuffer... bS)
A Binary Set data type.
NOTE: This method appends the values to the existing list (if
any). Use setBS(java.util.Collection)
or
withBS(java.util.Collection)
if you want to override the
existing values.
bS
- A Binary Set data type.public AttributeValue withBS(java.util.Collection<java.nio.ByteBuffer> bS)
A Binary Set data type.
bS
- A Binary Set data type.public java.util.Map<java.lang.String,AttributeValue> getM()
A Map of attribute values.
public void setM(java.util.Map<java.lang.String,AttributeValue> m)
A Map of attribute values.
m
- A Map of attribute values.public AttributeValue withM(java.util.Map<java.lang.String,AttributeValue> m)
A Map of attribute values.
m
- A Map of attribute values.public AttributeValue addMEntry(java.lang.String key, AttributeValue value)
public AttributeValue clearMEntries()
public java.util.List<AttributeValue> getL()
A List of attribute values.
public void setL(java.util.Collection<AttributeValue> l)
A List of attribute values.
l
- A List of attribute values.public AttributeValue withL(AttributeValue... l)
A List of attribute values.
NOTE: This method appends the values to the existing list (if
any). Use setL(java.util.Collection)
or
withL(java.util.Collection)
if you want to override the existing
values.
l
- A List of attribute values.public AttributeValue withL(java.util.Collection<AttributeValue> l)
A List of attribute values.
l
- A List of attribute values.public void setNULL(java.lang.Boolean nULLValue)
A Null data type.
nULLValue
- A Null data type.public java.lang.Boolean getNULL()
A Null data type.
public AttributeValue withNULL(java.lang.Boolean nULLValue)
A Null data type.
nULLValue
- A Null data type.public java.lang.Boolean isNULL()
A Null data type.
public void setBOOL(java.lang.Boolean bOOL)
A Boolean data type.
bOOL
- A Boolean data type.public java.lang.Boolean getBOOL()
A Boolean data type.
public AttributeValue withBOOL(java.lang.Boolean bOOL)
A Boolean data type.
bOOL
- A Boolean data type.public java.lang.Boolean isBOOL()
A Boolean data type.
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public AttributeValue clone()
clone
in class java.lang.Object