Class AttributeValue
- java.lang.Object
-
- com.amazonaws.services.dynamodbv2.model.AttributeValue
-
- All Implemented Interfaces:
Serializable
,Cloneable
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.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AttributeValue()
Default constructor for AttributeValue object.AttributeValue(String s)
Constructs a new AttributeValue object.AttributeValue(List<String> sS)
Constructs a new AttributeValue object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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(String... nS)
A Number Set data type.AttributeValue
withNS(Collection<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(String... sS)
A String Set data type.AttributeValue
withSS(Collection<String> sS)
A String Set data type.
-
-
-
Constructor Detail
-
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
public AttributeValue(String s)
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.
-
-
Method Detail
-
setS
public void setS(String s)
A String data type.
- Parameters:
s
- A String data type.
-
getS
public String getS()
A String data type.
- Returns:
- A String data type.
-
withS
public AttributeValue withS(String s)
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
public void setN(String n)
A Number data type.
- Parameters:
n
- A Number data type.
-
getN
public String getN()
A Number data type.
- Returns:
- A Number data type.
-
withN
public AttributeValue withN(String n)
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
public void setB(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.
- Parameters:
b
- A Binary data type.
-
getB
public ByteBuffer 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
public AttributeValue withB(ByteBuffer b)
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.
-
setSS
public void setSS(Collection<String> sS)
A String Set data type.
- Parameters:
sS
- A String Set data type.
-
withSS
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)
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
public AttributeValue withSS(Collection<String> sS)
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.
-
setNS
public void setNS(Collection<String> nS)
A Number Set data type.
- Parameters:
nS
- A Number Set data type.
-
withNS
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)
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
public AttributeValue withNS(Collection<String> nS)
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
public List<ByteBuffer> getBS()
A Binary Set data type.
- Returns:
- A Binary Set data type.
-
setBS
public void setBS(Collection<ByteBuffer> bS)
A Binary Set data type.
- Parameters:
bS
- A Binary Set data type.
-
withBS
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)
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
public AttributeValue withBS(Collection<ByteBuffer> bS)
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
public Map<String,AttributeValue> getM()
A Map of attribute values.
- Returns:
- A Map of attribute values.
-
setM
public void setM(Map<String,AttributeValue> m)
A Map of attribute values.
- Parameters:
m
- A Map of attribute values.
-
withM
public AttributeValue withM(Map<String,AttributeValue> m)
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
public AttributeValue addMEntry(String key, AttributeValue value)
-
clearMEntries
public AttributeValue clearMEntries()
Removes all the entries added into M. <p> Returns a reference to this object so that method calls can be chained together.
-
getL
public List<AttributeValue> getL()
A List of attribute values.
- Returns:
- A List of attribute values.
-
setL
public void setL(Collection<AttributeValue> l)
A List of attribute values.
- Parameters:
l
- A List of attribute values.
-
withL
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)
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
public AttributeValue withL(Collection<AttributeValue> l)
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
public void setNULL(Boolean nULLValue)
A Null data type.
- Parameters:
nULLValue
- A Null data type.
-
getNULL
public Boolean getNULL()
A Null data type.
- Returns:
- A Null data type.
-
withNULL
public AttributeValue withNULL(Boolean nULLValue)
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
public Boolean isNULL()
A Null data type.
- Returns:
- A Null data type.
-
setBOOL
public void setBOOL(Boolean bOOL)
A Boolean data type.
- Parameters:
bOOL
- A Boolean data type.
-
getBOOL
public Boolean getBOOL()
A Boolean data type.
- Returns:
- A Boolean data type.
-
withBOOL
public AttributeValue withBOOL(Boolean bOOL)
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
public Boolean isBOOL()
A Boolean data type.
- Returns:
- A Boolean data type.
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public AttributeValue clone()
-
-