Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   *
   *  http://aws.amazon.com/apache2.0
   *
  * or in the "license" file accompanying this file. 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.document.spec;
 
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
Full parameter specification for the UpdateItem API.
 
     private List<AttributeUpdateattributes;
     private Collection<Expectedexpected;
 
     private Map<StringStringnameMap;
     private Map<StringObjectvalueMap;
 
     public UpdateItemSpec() {
         super(new UpdateItemRequest());
     }
 
     @Override
     public UpdateItemSpec withPrimaryKey(KeyAttribute ... components) {
         super.withPrimaryKey(components);
         return this;
     }
 
     @Override
     public UpdateItemSpec withPrimaryKey(PrimaryKey primaryKey) {
         super.withPrimaryKey(primaryKey);
         return this;
     }
 
     @Override
     public UpdateItemSpec withPrimaryKey(String hashKeyNameObject hashKeyValue) {
         super.withPrimaryKey(hashKeyNamehashKeyValue);
         return this;
     }
 
     @Override
     public UpdateItemSpec withPrimaryKey(String hashKeyNameObject hashKeyValue,
             String rangeKeyNameObject rangeKeyValue) {
         super.withPrimaryKey(hashKeyNamehashKeyValuerangeKeyNamerangeKeyValue);
         return this;
     }
 
     public List<AttributeUpdategetAttributeUpdate() {
         return ;
     }
 
             List<AttributeUpdateattributeUpdates) {
         this. = attributeUpdates;
         return this;
     }
 
             AttributeUpdate... attributeUpdates) {
         this. = new ArrayList<AttributeUpdate>(Arrays.asList(attributeUpdates));
         return this;
     }
 
     public UpdateItemSpec addAttributeUpdate(AttributeUpdate attributeUpdate) {
         if (null == this.) {
             this. = new ArrayList<AttributeUpdate>();
         }
         this..add(attributeUpdate);
        return this;
    }
        this. = null;
        return this;
    }
    public Collection<ExpectedgetExpected() {
        return ;
    }
    public UpdateItemSpec withExpected(Expected ... expected) {
        if (expected == null) {
            this. = null;
            return this;
        }
        return withExpected(Arrays.asList(expected));
    }
    public UpdateItemSpec withExpected(Collection<Expectedexpected) {
        if (expected == null) {
            this. = null;
            return this;
        }
        Set<Stringnames = new LinkedHashSet<String>();
        for (Expected eexpected)
            names.add(e.getAttribute());
        if (names.size() != expected.size()) {
            throw new IllegalArgumentException(
                "attribute names must not duplicate in the list of expected");
        }
        this. = Collections.unmodifiableCollection(expected);
        return this;
    }
    public String getUpdateExpression() {
        return getRequest().getUpdateExpression();
    }
    public UpdateItemSpec withUpdateExpression(String updateExpression) {
        getRequest().setUpdateExpression(updateExpression);
        return this;
    }
    public String getConditionExpression() {
        return getRequest().getConditionExpression();
    }
    public UpdateItemSpec withConditionExpression(String conditionExpression) {
        getRequest().setConditionExpression(conditionExpression);
        return this;
    }
    public Map<StringStringgetNameMap() {
        return ;
    }

    
Applicable only when an expression has been specified. Used to specify the actual values for the attribute-name placeholders, where the value in the map can either be string for simple attribute name, or a JSON path expression.
    public UpdateItemSpec withNameMap(Map<StringStringnameMap) {
        if (nameMap == null) {
            this. = null;
        } else {
            this. = Collections.unmodifiableMap(
                new LinkedHashMap<StringString>(nameMap));
        }
        return this;
    }
    public Map<StringObjectgetValueMap() {
        return ;
    }

    
Applicable only when an expression has been specified. Used to specify the actual values for the attribute-value placeholders.
    public UpdateItemSpec withValueMap(Map<StringObjectvalueMap) {
        if (valueMap == null) {
            this. = null;
        } else {
            this. = Collections.unmodifiableMap(
                new LinkedHashMap<StringObject>(valueMap));
        }
        return this;
    }
    public String getConditionalOperator() {
        return getRequest().getConditionalOperator();
    }
    public String getReturnConsumedCapacity() {
        return getRequest().getReturnConsumedCapacity();
    }
            String returnConsumedCapacity) {
        getRequest().setReturnConsumedCapacity(returnConsumedCapacity);
        return this;
    }
            ReturnConsumedCapacity returnConsumedCapacity) {
        getRequest().setReturnConsumedCapacity(returnConsumedCapacity);
        return this;
    }
        return getRequest().getReturnItemCollectionMetrics();
    }
            ReturnItemCollectionMetrics returnItemCollectionMetrics) {
        getRequest().setReturnItemCollectionMetrics(returnItemCollectionMetrics);
        return this;
    }
            String returnItemCollectionMetrics) {
        getRequest().setReturnItemCollectionMetrics(returnItemCollectionMetrics);
        return this;
    }
    public String getReturnValues() {
        return getRequest().getReturnValues();
    }
    public UpdateItemSpec withReturnValues(ReturnValue returnValues) {
        getRequest().setReturnValues(returnValues);
        return this;
    }
    public UpdateItemSpec withReturnValues(String returnValues) {
        getRequest().setReturnValues(returnValues);
        return this;
    }
    @Override
    public UpdateItemSpec withProgressListener(ProgressListener progressListener) {
        setProgressListener(progressListener);
        return this;
    }
    @Override
            RequestMetricCollector requestMetricCollector) {
        setRequestMetricCollector(requestMetricCollector);
        return this;
    }

    
Convenient method to specify expressions (and the associated name map and value map) via com.amazonaws.services.dynamodbv2.xspec.UpdateItemExpressionSpec.
    @Beta
        return withUpdateExpression(xspec.getUpdateExpression())
              .withConditionExpression(xspec.getConditionExpression())
              .withNameMap(xspec.getNameMap())
              .withValueMap(xspec.getValueMap())
              ;
    }
New to GrepCode? Check out our FAQ X