public class ExpectedAttributeValue extends Object implements Serializable
Represents an attribute value used with conditional DeleteItem , PutItem or UpdateItem operations. DynamoDB will check to see if the attribute value already exists; or if the attribute exists and has a particular value before updating it.
Constructor and Description |
---|
ExpectedAttributeValue()
Default constructor for a new ExpectedAttributeValue object.
|
ExpectedAttributeValue(AttributeValue value)
Constructs a new ExpectedAttributeValue object.
|
ExpectedAttributeValue(Boolean exists)
Constructs a new ExpectedAttributeValue object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Boolean |
getExists()
Causes DynamoDB to evaluate the value before attempting a conditional
operation:
|
AttributeValue |
getValue()
Represents the data for an attribute.
|
int |
hashCode() |
Boolean |
isExists()
Causes DynamoDB to evaluate the value before attempting a conditional
operation:
|
void |
setExists(Boolean exists)
Causes DynamoDB to evaluate the value before attempting a conditional
operation:
|
void |
setValue(AttributeValue value)
Represents the data for an attribute.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
ExpectedAttributeValue |
withExists(Boolean exists)
Causes DynamoDB to evaluate the value before attempting a conditional
operation:
|
ExpectedAttributeValue |
withValue(AttributeValue value)
Represents the data for an attribute.
|
public ExpectedAttributeValue()
public ExpectedAttributeValue(AttributeValue value)
value
- Represents the data for an attribute. You can set one,
and only one, of the elements.public ExpectedAttributeValue(Boolean exists)
exists
- Causes DynamoDB to evaluate the value before attempting
a conditional operation: If Exists is
true
, DynamoDB will check to see if that attribute value
already exists in the table. If it is found, then the operation
succeeds. If it is not found, the operation fails with a
ConditionalCheckFailedException.
If Exists
is false
, DynamoDB assumes that the attribute value does
not exist in the table. If in fact the value does not exist,
then the assumption is valid and the operation succeeds. If the value
is found, despite the assumption that it does not exist, the operation
fails with a ConditionalCheckFailedException.
The default setting for Exists is true
. If you
supply a Value all by itself, DynamoDB assumes the attribute
exists: You don't have to set Exists to true
,
because it is implied.
DynamoDB returns a ValidationException if:
Exists is
true
but there is no Value to check. (You expect a
value to exist, but don't specify what that value is.)
Exists is false
but you also specify a
Value. (You cannot expect an attribute to have a value, while
also expecting it not to exist.)
If you specify more than one condition for Exists, then all of the conditions must evaluate to true. (In other words, the conditions are ANDed together.) Otherwise, the conditional operation will fail.
public AttributeValue getValue()
public void setValue(AttributeValue value)
value
- Represents the data for an attribute. You can set one, and only one,
of the elements.public ExpectedAttributeValue withValue(AttributeValue value)
Returns a reference to this object so that method calls can be chained together.
value
- Represents the data for an attribute. You can set one, and only one,
of the elements.public Boolean isExists()
If Exists is true
,
DynamoDB will check to see if that attribute value already exists in
the table. If it is found, then the operation succeeds. If it is not
found, the operation fails with a
ConditionalCheckFailedException.
If Exists
is false
, DynamoDB assumes that the attribute value does
not exist in the table. If in fact the value does not exist,
then the assumption is valid and the operation succeeds. If the value
is found, despite the assumption that it does not exist, the operation
fails with a ConditionalCheckFailedException.
The default setting for Exists is true
. If you
supply a Value all by itself, DynamoDB assumes the attribute
exists: You don't have to set Exists to true
,
because it is implied.
DynamoDB returns a ValidationException if:
Exists is
true
but there is no Value to check. (You expect a
value to exist, but don't specify what that value is.)
Exists is false
but you also specify a
Value. (You cannot expect an attribute to have a value, while
also expecting it not to exist.)
If you specify more than one condition for Exists, then all of the conditions must evaluate to true. (In other words, the conditions are ANDed together.) Otherwise, the conditional operation will fail.
If Exists is true
,
DynamoDB will check to see if that attribute value already exists in
the table. If it is found, then the operation succeeds. If it is not
found, the operation fails with a
ConditionalCheckFailedException.
If Exists
is false
, DynamoDB assumes that the attribute value does
not exist in the table. If in fact the value does not exist,
then the assumption is valid and the operation succeeds. If the value
is found, despite the assumption that it does not exist, the operation
fails with a ConditionalCheckFailedException.
The default setting for Exists is true
. If you
supply a Value all by itself, DynamoDB assumes the attribute
exists: You don't have to set Exists to true
,
because it is implied.
DynamoDB returns a ValidationException if:
Exists is
true
but there is no Value to check. (You expect a
value to exist, but don't specify what that value is.)
Exists is false
but you also specify a
Value. (You cannot expect an attribute to have a value, while
also expecting it not to exist.)
If you specify more than one condition for Exists, then all of the conditions must evaluate to true. (In other words, the conditions are ANDed together.) Otherwise, the conditional operation will fail.
public void setExists(Boolean exists)
If Exists is true
,
DynamoDB will check to see if that attribute value already exists in
the table. If it is found, then the operation succeeds. If it is not
found, the operation fails with a
ConditionalCheckFailedException.
If Exists
is false
, DynamoDB assumes that the attribute value does
not exist in the table. If in fact the value does not exist,
then the assumption is valid and the operation succeeds. If the value
is found, despite the assumption that it does not exist, the operation
fails with a ConditionalCheckFailedException.
The default setting for Exists is true
. If you
supply a Value all by itself, DynamoDB assumes the attribute
exists: You don't have to set Exists to true
,
because it is implied.
DynamoDB returns a ValidationException if:
Exists is
true
but there is no Value to check. (You expect a
value to exist, but don't specify what that value is.)
Exists is false
but you also specify a
Value. (You cannot expect an attribute to have a value, while
also expecting it not to exist.)
If you specify more than one condition for Exists, then all of the conditions must evaluate to true. (In other words, the conditions are ANDed together.) Otherwise, the conditional operation will fail.
exists
- Causes DynamoDB to evaluate the value before attempting a conditional
operation: If Exists is true
,
DynamoDB will check to see if that attribute value already exists in
the table. If it is found, then the operation succeeds. If it is not
found, the operation fails with a
ConditionalCheckFailedException.
If Exists
is false
, DynamoDB assumes that the attribute value does
not exist in the table. If in fact the value does not exist,
then the assumption is valid and the operation succeeds. If the value
is found, despite the assumption that it does not exist, the operation
fails with a ConditionalCheckFailedException.
The default setting for Exists is true
. If you
supply a Value all by itself, DynamoDB assumes the attribute
exists: You don't have to set Exists to true
,
because it is implied.
DynamoDB returns a ValidationException if:
Exists is
true
but there is no Value to check. (You expect a
value to exist, but don't specify what that value is.)
Exists is false
but you also specify a
Value. (You cannot expect an attribute to have a value, while
also expecting it not to exist.)
If you specify more than one condition for Exists, then all of the conditions must evaluate to true. (In other words, the conditions are ANDed together.) Otherwise, the conditional operation will fail.
public ExpectedAttributeValue withExists(Boolean exists)
If Exists is true
,
DynamoDB will check to see if that attribute value already exists in
the table. If it is found, then the operation succeeds. If it is not
found, the operation fails with a
ConditionalCheckFailedException.
If Exists
is false
, DynamoDB assumes that the attribute value does
not exist in the table. If in fact the value does not exist,
then the assumption is valid and the operation succeeds. If the value
is found, despite the assumption that it does not exist, the operation
fails with a ConditionalCheckFailedException.
The default setting for Exists is true
. If you
supply a Value all by itself, DynamoDB assumes the attribute
exists: You don't have to set Exists to true
,
because it is implied.
DynamoDB returns a ValidationException if:
Exists is
true
but there is no Value to check. (You expect a
value to exist, but don't specify what that value is.)
Exists is false
but you also specify a
Value. (You cannot expect an attribute to have a value, while
also expecting it not to exist.)
If you specify more than one condition for Exists, then all of the conditions must evaluate to true. (In other words, the conditions are ANDed together.) Otherwise, the conditional operation will fail.
Returns a reference to this object so that method calls can be chained together.
exists
- Causes DynamoDB to evaluate the value before attempting a conditional
operation: If Exists is true
,
DynamoDB will check to see if that attribute value already exists in
the table. If it is found, then the operation succeeds. If it is not
found, the operation fails with a
ConditionalCheckFailedException.
If Exists
is false
, DynamoDB assumes that the attribute value does
not exist in the table. If in fact the value does not exist,
then the assumption is valid and the operation succeeds. If the value
is found, despite the assumption that it does not exist, the operation
fails with a ConditionalCheckFailedException.
The default setting for Exists is true
. If you
supply a Value all by itself, DynamoDB assumes the attribute
exists: You don't have to set Exists to true
,
because it is implied.
DynamoDB returns a ValidationException if:
Exists is
true
but there is no Value to check. (You expect a
value to exist, but don't specify what that value is.)
Exists is false
but you also specify a
Value. (You cannot expect an attribute to have a value, while
also expecting it not to exist.)
If you specify more than one condition for Exists, then all of the conditions must evaluate to true. (In other words, the conditions are ANDed together.) Otherwise, the conditional operation will fail.
public Boolean getExists()
If Exists is true
,
DynamoDB will check to see if that attribute value already exists in
the table. If it is found, then the operation succeeds. If it is not
found, the operation fails with a
ConditionalCheckFailedException.
If Exists
is false
, DynamoDB assumes that the attribute value does
not exist in the table. If in fact the value does not exist,
then the assumption is valid and the operation succeeds. If the value
is found, despite the assumption that it does not exist, the operation
fails with a ConditionalCheckFailedException.
The default setting for Exists is true
. If you
supply a Value all by itself, DynamoDB assumes the attribute
exists: You don't have to set Exists to true
,
because it is implied.
DynamoDB returns a ValidationException if:
Exists is
true
but there is no Value to check. (You expect a
value to exist, but don't specify what that value is.)
Exists is false
but you also specify a
Value. (You cannot expect an attribute to have a value, while
also expecting it not to exist.)
If you specify more than one condition for Exists, then all of the conditions must evaluate to true. (In other words, the conditions are ANDed together.) Otherwise, the conditional operation will fail.
If Exists is true
,
DynamoDB will check to see if that attribute value already exists in
the table. If it is found, then the operation succeeds. If it is not
found, the operation fails with a
ConditionalCheckFailedException.
If Exists
is false
, DynamoDB assumes that the attribute value does
not exist in the table. If in fact the value does not exist,
then the assumption is valid and the operation succeeds. If the value
is found, despite the assumption that it does not exist, the operation
fails with a ConditionalCheckFailedException.
The default setting for Exists is true
. If you
supply a Value all by itself, DynamoDB assumes the attribute
exists: You don't have to set Exists to true
,
because it is implied.
DynamoDB returns a ValidationException if:
Exists is
true
but there is no Value to check. (You expect a
value to exist, but don't specify what that value is.)
Exists is false
but you also specify a
Value. (You cannot expect an attribute to have a value, while
also expecting it not to exist.)
If you specify more than one condition for Exists, then all of the conditions must evaluate to true. (In other words, the conditions are ANDed together.) Otherwise, the conditional operation will fail.
public String toString()
toString
in class Object
Object.toString()
Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.