public class AttributeValue extends Object implements 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.
Constructor and Description |
---|
AttributeValue()
Default constructor for a new AttributeValue object.
|
AttributeValue(List<String> sS)
Constructs a new AttributeValue object.
|
AttributeValue(String s)
Constructs a new AttributeValue object.
|
Modifier and Type | Method and Description |
---|---|
AttributeValue |
addMEntry(String key,
AttributeValue value)
A Map of attribute values.
|
AttributeValue |
clearMEntries()
Removes all the entries added into M.
|
AttributeValue |
clone() |
boolean |
equals(Object obj) |
ByteBuffer |
getB()
A Binary data type.
|
Boolean |
getBOOL()
A Boolean data type.
|
List<ByteBuffer> |
getBS()
A Binary Set data type.
|
List<AttributeValue> |
getL()
A List of attribute values.
|
Map<String,AttributeValue> |
getM()
A Map of attribute values.
|
String |
getN()
A Number data type.
|
List<String> |
getNS()
A Number Set data type.
|
Boolean |
getNULL()
A Null data type.
|
String |
getS()
A String data type.
|
List<String> |
getSS()
A String Set data type.
|
int |
hashCode() |
Boolean |
isBOOL()
A Boolean data type.
|
Boolean |
isNULL()
A Null data type.
|
void |
setB(ByteBuffer b)
A Binary data type.
|
void |
setBOOL(Boolean bOOL)
A Boolean data type.
|
void |
setBS(Collection<ByteBuffer> bS)
A Binary Set data type.
|
void |
setL(Collection<AttributeValue> l)
A List of attribute values.
|
void |
setM(Map<String,AttributeValue> m)
A Map of attribute values.
|
void |
setN(String n)
A Number data type.
|
void |
setNS(Collection<String> nS)
A Number Set data type.
|
void |
setNULL(Boolean nULL)
A Null data type.
|
void |
setS(String s)
A String data type.
|
void |
setSS(Collection<String> sS)
A String Set data type.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
AttributeValue |
withB(ByteBuffer b)
A Binary data type.
|
AttributeValue |
withBOOL(Boolean bOOL)
A Boolean data type.
|
AttributeValue |
withBS(ByteBuffer... bS)
A Binary Set data type.
|
AttributeValue |
withBS(Collection<ByteBuffer> bS)
A Binary Set data type.
|
AttributeValue |
withL(AttributeValue... l)
A List of attribute values.
|
AttributeValue |
withL(Collection<AttributeValue> l)
A List of attribute values.
|
AttributeValue |
withM(Map<String,AttributeValue> m)
A Map of attribute values.
|
AttributeValue |
withN(String n)
A Number data type.
|
AttributeValue |
withNS(Collection<String> nS)
A Number Set data type.
|
AttributeValue |
withNS(String... nS)
A Number Set data type.
|
AttributeValue |
withNULL(Boolean nULL)
A Null data type.
|
AttributeValue |
withS(String s)
A String data type.
|
AttributeValue |
withSS(Collection<String> sS)
A String Set data type.
|
AttributeValue |
withSS(String... sS)
A String Set data type.
|
public AttributeValue()
public AttributeValue(String s)
s
- A String data type.public String getS()
public void setS(String s)
s
- A String data type.public AttributeValue withS(String s)
Returns a reference to this object so that method calls can be chained together.
s
- A String data type.public String getN()
public void setN(String n)
n
- A Number data type.public AttributeValue withN(String n)
Returns a reference to this object so that method calls can be chained together.
n
- A Number data type.public ByteBuffer getB()
public void setB(ByteBuffer b)
b
- A Binary data type.public AttributeValue withB(ByteBuffer b)
Returns a reference to this object so that method calls can be chained together.
b
- A Binary data type.public void setSS(Collection<String> sS)
sS
- A String Set data type.public AttributeValue withSS(String... sS)
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.
Returns a reference to this object so that method calls can be chained together.
sS
- A String Set data type.public AttributeValue withSS(Collection<String> sS)
Returns a reference to this object so that method calls can be chained together.
sS
- A String Set data type.public void setNS(Collection<String> nS)
nS
- A Number Set data type.public AttributeValue withNS(String... nS)
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.
Returns a reference to this object so that method calls can be chained together.
nS
- A Number Set data type.public AttributeValue withNS(Collection<String> nS)
Returns a reference to this object so that method calls can be chained together.
nS
- A Number Set data type.public List<ByteBuffer> getBS()
public void setBS(Collection<ByteBuffer> bS)
bS
- A Binary Set data type.public AttributeValue withBS(ByteBuffer... bS)
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.
Returns a reference to this object so that method calls can be chained together.
bS
- A Binary Set data type.public AttributeValue withBS(Collection<ByteBuffer> bS)
Returns a reference to this object so that method calls can be chained together.
bS
- A Binary Set data type.public Map<String,AttributeValue> getM()
public void setM(Map<String,AttributeValue> m)
m
- A Map of attribute values.public AttributeValue withM(Map<String,AttributeValue> m)
Returns a reference to this object so that method calls can be chained together.
m
- A Map of attribute values.public AttributeValue addMEntry(String key, AttributeValue value)
The method adds a new key-value pair into M parameter, and returns a reference to this object so that method calls can be chained together.
key
- The key of the entry to be added into M.value
- The corresponding value of the entry to be added into M.public AttributeValue clearMEntries()
Returns a reference to this object so that method calls can be chained together.
public List<AttributeValue> getL()
public void setL(Collection<AttributeValue> l)
l
- A List of attribute values.public AttributeValue withL(AttributeValue... l)
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.
Returns a reference to this object so that method calls can be chained together.
l
- A List of attribute values.public AttributeValue withL(Collection<AttributeValue> l)
Returns a reference to this object so that method calls can be chained together.
l
- A List of attribute values.public Boolean isNULL()
public void setNULL(Boolean nULL)
nULL
- A Null data type.public AttributeValue withNULL(Boolean nULL)
Returns a reference to this object so that method calls can be chained together.
nULL
- A Null data type.public Boolean getNULL()
public Boolean isBOOL()
public void setBOOL(Boolean bOOL)
bOOL
- A Boolean data type.public AttributeValue withBOOL(Boolean bOOL)
Returns a reference to this object so that method calls can be chained together.
bOOL
- A Boolean data type.public Boolean getBOOL()
public String toString()
toString
in class Object
Object.toString()
public AttributeValue clone()
Copyright © 2015. All rights reserved.