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 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) |
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 nULLValue)
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 nULLValue)
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 void setS(String s)
A String data type.
s
- A String data type.public String getS()
A String data type.
public AttributeValue withS(String s)
A String data type.
s
- A String data type.public void setN(String n)
A Number data type.
n
- A Number data type.public String getN()
A Number data type.
public AttributeValue withN(String n)
A Number data type.
n
- A Number data type.public void setB(ByteBuffer b)
A Binary data type.
b
- A Binary data type.public 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(ByteBuffer b)
A Binary data type.
b
- A Binary data type.public void setSS(Collection<String> sS)
A String Set data type.
sS
- A String Set data type.public AttributeValue withSS(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(Collection<String> sS)
A String Set data type.
sS
- A String Set data type.public void setNS(Collection<String> nS)
A Number Set data type.
nS
- A Number Set data type.public AttributeValue withNS(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(Collection<String> nS)
A Number Set data type.
nS
- A Number Set data type.public List<ByteBuffer> getBS()
A Binary Set data type.
public void setBS(Collection<ByteBuffer> bS)
A Binary Set data type.
bS
- A Binary Set data type.public AttributeValue withBS(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(Collection<ByteBuffer> bS)
A Binary Set data type.
bS
- A Binary Set data type.public Map<String,AttributeValue> getM()
A Map of attribute values.
public void setM(Map<String,AttributeValue> m)
A Map of attribute values.
m
- A Map of attribute values.public AttributeValue withM(Map<String,AttributeValue> m)
A Map of attribute values.
m
- A Map of attribute values.public AttributeValue addMEntry(String key, AttributeValue value)
public AttributeValue clearMEntries()
public List<AttributeValue> getL()
A List of attribute values.
public void setL(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(Collection<AttributeValue> l)
A List of attribute values.
l
- A List of attribute values.public void setNULL(Boolean nULLValue)
A Null data type.
nULLValue
- A Null data type.public Boolean getNULL()
A Null data type.
public AttributeValue withNULL(Boolean nULLValue)
A Null data type.
nULLValue
- A Null data type.public Boolean isNULL()
A Null data type.
public void setBOOL(Boolean bOOL)
A Boolean data type.
bOOL
- A Boolean data type.public Boolean getBOOL()
A Boolean data type.
public AttributeValue withBOOL(Boolean bOOL)
A Boolean data type.
bOOL
- A Boolean data type.public Boolean isBOOL()
A Boolean data type.
public String toString()
toString
in class Object
Object.toString()
public AttributeValue clone()
Copyright © 2015. All rights reserved.