private PutItemOutcome doPutItem(PutItemSpec spec) { // set the table name String tableName = getTable().getTableName(); PutItemRequest req = spec.getRequest().withTableName(tableName); // set up the item Item item = spec.getItem(); final Map<String,AttributeValue> attributes = InternalUtils.toAttributeValues(item); // set up the expected attribute map, if any final Map<String, ExpectedAttributeValue> expectedMap = InternalUtils.toExpectedAttributeValueMap(spec.getExpected()); // set up the value map, if any (when expression API is used) final Map<String,AttributeValue> attrValMap = InternalUtils.fromSimpleMap(spec.getValueMap()); // set up the request req.withItem(attributes) .withExpected(expectedMap) .withExpressionAttributeNames(spec.getNameMap()) .withExpressionAttributeValues(attrValMap) ; PutItemResult result = getClient().putItem(req); return new PutItemOutcome(result); } }
private PutItemOutcome doPutItem(PutItemSpec spec) { // set the table name String tableName = getTable().getTableName(); PutItemRequest req = spec.getRequest().withTableName(tableName); // set up the item Item item = spec.getItem(); final Map<String,AttributeValue> attributes = InternalUtils.toAttributeValues(item); // set up the expected attribute map, if any final Map<String, ExpectedAttributeValue> expectedMap = InternalUtils.toExpectedAttributeValueMap(spec.getExpected()); // set up the value map, if any (when expression API is used) final Map<String,AttributeValue> attrValMap = InternalUtils.fromSimpleMap(spec.getValueMap()); // set up the request req.withItem(attributes) .withExpected(expectedMap) .withExpressionAttributeNames(spec.getNameMap()) .withExpressionAttributeValues(attrValMap) ; PutItemResult result = getClient().putItem(req); return new PutItemOutcome(result); } }