Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2011-2015 Amazon Technologies, Inc.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at:
   *
   *    http://aws.amazon.com/apache2.0
   *
  * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
  * OR CONDITIONS OF ANY KIND, either express or implied. See the
  * License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package com.amazonaws.services.dynamodbv2.datamodeling;
 
 import java.util.Map;
 
Enables adding options to a delete operation. For example, you may want to delete only if an attribute has a particular value.

 
 public class DynamoDBDeleteExpression {

    
Optional expected attributes
 
     private Map<StringExpectedAttributeValueexpectedAttributes;

    
The logical operator on the expected attribute conditions
 
     private String conditionalOperator;

    
A condition that must be satisfied in order for a conditional DeleteItem to succeed.
 
     private String conditionExpression;

    
One or more substitution variables for simplifying complex expressions.
 
     private java.util.Map<String,StringexpressionAttributeNames;

    
One or more values that can be substituted in an expression.
 
Gets the map of attribute names to expected attribute values to check on delete.

Returns:
The map of attribute names to expected attribute value conditions to check on delete
 
     public Map<StringExpectedAttributeValuegetExpected() {
         return ;
     }

    
Sets the expected condition to the map of attribute names to expected attribute values given.

Parameters:
expectedAttributes The map of attribute names to expected attribute value conditions to check on delete
 
     public void setExpected(Map<StringExpectedAttributeValueexpectedAttributes) {
         this. = expectedAttributes;
     }

    
Sets the expected condition to the map of attribute names to expected attribute values given and returns a pointer to this object for method-chaining.

Parameters:
expectedAttributes The map of attribute names to expected attribute value conditions to check on delete
 
     public DynamoDBDeleteExpression withExpected(Map<StringExpectedAttributeValueexpectedAttributes) {
         setExpected(expectedAttributes);
         return this;
     }

    
Adds one entry to the expected conditions and returns a pointer to this object for method-chaining.

Parameters:
attributeName The name of the attribute.
expected The expected attribute value.
 
     public DynamoDBDeleteExpression withExpectedEntry(String attributeNameExpectedAttributeValue expected) {
         if ( == null) {
             = new HashMap<String,ExpectedAttributeValue>();
        }
        .put(attributeNameexpected);
        return this;
    }

    
Returns the logical operator on the expected attribute conditions of this delete operation.
    public String getConditionalOperator() {
        return ;
    }

    
Sets the logical operator on the expected attribute conditions of this delete operation.
    public void setConditionalOperator(String conditionalOperator) {
        this. = conditionalOperator;
    }

    
Sets the logical operator on the expected attribute conditions of this delete operation and returns a pointer to this object for method-chaining.
    public DynamoDBDeleteExpression withConditionalOperator(String conditionalOperator) {
        setConditionalOperator(conditionalOperator);
        return this;
    }

    
Sets the logical operator on the expected attribute conditions of this delete operation.
    public void setConditionalOperator(ConditionalOperator conditionalOperator) {
        setConditionalOperator(conditionalOperator.toString());
    }

    
Sets the logical operator on the expected attribute conditions of this delete operation and returns a pointer to this object for method-chaining.
        return withConditionalOperator(conditionalOperator.toString());
    }

    
A condition that must be satisfied in order for a conditional DeleteItem to succeed.

    public String getConditionExpression() {
        return ;
    }

    
A condition that must be satisfied in order for a conditional DeleteItem to succeed.

    public void setConditionExpression(String conditionExpression) {
        this. = conditionExpression;
    }

    
A condition that must be satisfied in order for a conditional DeleteItem to succeed.

Returns:
A reference to this updated object so that method calls can be chained together.
See also:
com.amazonaws.services.dynamodbv2.model.DeleteItemRequest.withConditionExpression(java.lang.String)
            String conditionExpression) {
        this. = conditionExpression;
        return this;
    }

    
One or more substitution variables for simplifying complex expressions.

Returns:
One or more substitution variables for simplifying complex expressions.
See also:
com.amazonaws.services.dynamodbv2.model.DeleteItemRequest.getExpressionAttributeNames()
        return ;
    }

    
One or more substitution variables for simplifying complex expressions.

Parameters:
expressionAttributeNames One or more substitution variables for simplifying complex expressions.
See also:
com.amazonaws.services.dynamodbv2.model.DeleteItemRequest.setExpressionAttributeNames(java.util.Map)
    public void setExpressionAttributeNames(
            java.util.Map<StringStringexpressionAttributeNames) {
        this. = expressionAttributeNames;
    }

    
One or more substitution variables for simplifying complex expressions.

Parameters:
expressionAttributeNames One or more substitution variables for simplifying complex expressions.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
com.amazonaws.services.dynamodbv2.model.DeleteItemRequest.withExpressionAttributeNames(java.util.Map)
            java.util.Map<StringStringexpressionAttributeNames) {
        setExpressionAttributeNames(expressionAttributeNames);
        return this;
    }

    
One or more substitution variables for simplifying complex expressions. The method adds a new key-value pair into ExpressionAttributeNames parameter, and returns a reference to this object so that method calls can be chained together.

Parameters:
key The key of the entry to be added into ExpressionAttributeNames.
value The corresponding value of the entry to be added into ExpressionAttributeNames.
See also:
com.amazonaws.services.dynamodbv2.model.DeleteItemRequest.addExpressionAttributeNamesEntry(java.lang.String,java.lang.String)
            String keyString value) {
        if (null == this.) {
            this. = new java.util.HashMap<StringString>();
        }
        if (this..containsKey(key))
            throw new IllegalArgumentException("Duplicated keys ("
                    + key.toString() + ") are provided.");
        this..put(keyvalue);
        return this;
    }

    
Removes all the entries added into ExpressionAttributeNames.

Returns a reference to this object so that method calls can be chained together.

        this. = null;
        return this;
    }

    
One or more values that can be substituted in an expression.

Returns:
One or more values that can be substituted in an expression.
See also:
com.amazonaws.services.dynamodbv2.model.DeleteItemRequest.getExpressionAttributeValues()
        return ;
    }

    
One or more values that can be substituted in an expression.

Parameters:
expressionAttributeValues One or more values that can be substituted in an expression.
See also:
com.amazonaws.services.dynamodbv2.model.DeleteItemRequest.setExpressionAttributeValues(java.util.Map)
    public void setExpressionAttributeValues(
            java.util.Map<StringAttributeValueexpressionAttributeValues) {
        this. = expressionAttributeValues;
    }

    
One or more values that can be substituted in an expression.

Parameters:
expressionAttributeValues One or more values that can be substituted in an expression.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
com.amazonaws.services.dynamodbv2.model.DeleteItemRequest.withExpressionAttributeValues(java.util.Map)
            java.util.Map<StringAttributeValueexpressionAttributeValues) {
        setExpressionAttributeValues(expressionAttributeValues);
        return this;
    }

    
One or more values that can be substituted in an expression. The method adds a new key-value pair into ExpressionAttributeValues parameter, and returns a reference to this object so that method calls can be chained together.

Parameters:
key The key of the entry to be added into ExpressionAttributeValues.
value The corresponding value of the entry to be added into ExpressionAttributeValues.
See also:
com.amazonaws.services.dynamodbv2.model.DeleteItemRequest.addExpressionAttributeValuesEntry(java.lang.String,com.amazonaws.services.dynamodbv2.model.AttributeValue)
            String keyAttributeValue value) {
        if (null == this.) {
            this. = new java.util.HashMap<StringAttributeValue>();
        }
        if (this..containsKey(key))
            throw new IllegalArgumentException("Duplicated keys ("
                    + key.toString() + ") are provided.");
        this..put(keyvalue);
        return this;
    }

    
Removes all the entries added into ExpressionAttributeValues.

Returns a reference to this object so that method calls can be chained together.

        this. = null;
        return this;
    }
New to GrepCode? Check out our FAQ X