Map<String, ExpectedAttributeValue> expectedValues = new HashMap<String, ExpectedAttributeValue>();
String hashKeyAttributeName = reflector.getAttributeName(hashKeyGetter);
Object hashGetterResult = safeInvoke(hashKeyGetter, object);
attributes.put(hashKeyAttributeName, getSimpleAttributeValue(hashKeyGetter, hashGetterResult));
expectedValues.put(hashKeyAttributeName, new ExpectedAttributeValue().withExists(false));
if (rangeKeyGetter != null) {
String rangeKeyAttributeName = reflector.getAttributeName(rangeKeyGetter);
Object rangeGetterResult = safeInvoke(rangeKeyGetter, object);
attributes.put(rangeKeyAttributeName, getSimpleAttributeValue(rangeKeyGetter, rangeGetterResult));
expectedValues.put(rangeKeyAttributeName, new ExpectedAttributeValue().withExists(false));
}
attributes = transformAttributes(clazz, attributes);
db.putItem(applyUserAgent(new PutItemRequest().withTableName(tableName).withItem(attributes)
.withExpected(expectedValues)));
}