/** * Constructs a new PutRequest object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param item * A map of attribute name to attribute values, representing the primary key of an item to be processed by * <code>PutItem</code>. All of the table's primary key attributes must be specified, and their data types * must match those of the table's key schema. If any attributes are present in the item which are part of an * index key schema for the table, their types must match the index key schema. */ public PutRequest(java.util.Map<String, AttributeValue> item) { setItem(item); }
/** * <p> * A map of attribute name to attribute values, representing the primary key of an item to be processed by * <code>PutItem</code>. All of the table's primary key attributes must be specified, and their data types must * match those of the table's key schema. If any attributes are present in the item which are part of an index key * schema for the table, their types must match the index key schema. * </p> * * @param item * A map of attribute name to attribute values, representing the primary key of an item to be processed by * <code>PutItem</code>. All of the table's primary key attributes must be specified, and their data types * must match those of the table's key schema. If any attributes are present in the item which are part of an * index key schema for the table, their types must match the index key schema. * @return Returns a reference to this object so that method calls can be chained together. */ public PutRequest withItem(java.util.Map<String, AttributeValue> item) { setItem(item); return this; }
/** * Constructs a new PutRequest object. Callers should use the setter or * fluent setter (with...) methods to initialize any additional object * members. * * @param item <p> * A map of attribute name to attribute values, representing the * primary key of an item to be processed by <code>PutItem</code> * . All of the table's primary key attributes must be specified, * and their data types must match those of the table's key * schema. If any attributes are present in the item which are * part of an index key schema for the table, their types must * match the index key schema. * </p> */ public PutRequest(java.util.Map<String, AttributeValue> item) { setItem(item); }
public PutRequest unmarshall(JsonUnmarshallerContext context) throws Exception { PutRequest putRequest = new PutRequest(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Item", targetDepth)) { context.nextToken(); putRequest.setItem(new MapUnmarshaller<String, AttributeValue>(context.getUnmarshaller(String.class), AttributeValueJsonUnmarshaller .getInstance()).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return putRequest; }
/** * Constructs a new PutRequest object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param item * A map of attribute name to attribute values, representing the primary key of an item to be processed by * <code>PutItem</code>. All of the table's primary key attributes must be specified, and their data types * must match those of the table's key schema. If any attributes are present in the item which are part of an * index key schema for the table, their types must match the index key schema. */ public PutRequest(java.util.Map<String, AttributeValue> item) { setItem(item); }
public PutRequest unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } PutRequest putRequest = new PutRequest(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Item")) { putRequest.setItem(new MapUnmarshaller<AttributeValue>( AttributeValueJsonUnmarshaller.getInstance() ) .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return putRequest; }
/** * <p> * A map of attribute name to attribute values, representing the primary key of an item to be processed by * <code>PutItem</code>. All of the table's primary key attributes must be specified, and their data types must * match those of the table's key schema. If any attributes are present in the item which are part of an index key * schema for the table, their types must match the index key schema. * </p> * * @param item * A map of attribute name to attribute values, representing the primary key of an item to be processed by * <code>PutItem</code>. All of the table's primary key attributes must be specified, and their data types * must match those of the table's key schema. If any attributes are present in the item which are part of an * index key schema for the table, their types must match the index key schema. * @return Returns a reference to this object so that method calls can be chained together. */ public PutRequest withItem(java.util.Map<String, AttributeValue> item) { setItem(item); return this; }
public PutPointRequest(GeoPoint geoPoint, AttributeValue rangeKeyValue) { putItemRequest = new PutItemRequest(); putItemRequest.setItem(new HashMap<String, AttributeValue>()); putRequest = new PutRequest(); putRequest.setItem(new HashMap<String, AttributeValue>()); this.geoPoint = geoPoint; this.rangeKeyValue = rangeKeyValue; }
public PutRequest unmarshall(JsonUnmarshallerContext context) throws Exception { PutRequest putRequest = new PutRequest(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Item", targetDepth)) { context.nextToken(); putRequest.setItem(new MapUnmarshaller<String, AttributeValue>(context.getUnmarshaller(String.class), AttributeValueJsonUnmarshaller .getInstance()).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return putRequest; }