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 save operation. For example, you may want to save only if an attribute has a particular value.

 
 public class DynamoDBSaveExpression {

    
Optional expected attributes
 
     private Map<StringExpectedAttributeValueexpectedAttributes;

    
The logical operator on the expected value conditions of this save operation.
 
     private String conditionalOperator;

    
Gets the map of attribute names to expected attribute values to check on save.

Returns:
The map of attribute names to expected attribute value conditions to check on save
 
     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 save
 
     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 save
 
     public DynamoDBSaveExpression 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 DynamoDBSaveExpression withExpectedEntry(String attributeNameExpectedAttributeValue expected) {
         if ( == null) {
              = new HashMap<String,ExpectedAttributeValue>();
         }
         .put(attributeNameexpected);
         return this;
     }

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

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

    
Sets the logical operator on the expected value conditions of this save operation and returns a pointer to this object for method-chaining.
    public DynamoDBSaveExpression withConditionalOperator(String conditionalOperator) {
        setConditionalOperator(conditionalOperator);
        return this;
    }
    
    
Sets the logical operator on the expected value conditions of this save operation.
    public void setConditionalOperator(ConditionalOperator conditionalOperator) {
        setConditionalOperator(conditionalOperator.toString());
    }

    
Sets the logical operator on the expected value conditions of this save operation and returns a pointer to this object for method-chaining.
        return withConditionalOperator(conditionalOperator.toString());
    }
New to GrepCode? Check out our FAQ X