/** * <p> * A map of attribute names to <code>AttributeValue</code> objects, as specified by * <code>ProjectionExpression</code>. * </p> * * @param item * A map of attribute names to <code>AttributeValue</code> objects, as specified by * <code>ProjectionExpression</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public GetItemResult withItem(java.util.Map<String, AttributeValue> item) { setItem(item); return this; }
if (context.testExpression("Item", targetDepth)) { context.nextToken(); getItemResult.setItem(new MapUnmarshaller<String, AttributeValue>(context.getUnmarshaller(String.class), AttributeValueJsonUnmarshaller .getInstance()).unmarshall(context));
public GetItemResult unmarshall(JsonUnmarshallerContext context) throws Exception { GetItemResult getItemResult = new GetItemResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Item")) { getItemResult.setItem(new MapUnmarshaller<AttributeValue>( AttributeValueJsonUnmarshaller.getInstance() ) .unmarshall(context)); } else if (name.equals("ConsumedCapacity")) { getItemResult.setConsumedCapacity(ConsumedCapacityJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return getItemResult; }
/** * <p> * A map of attribute names to <code>AttributeValue</code> objects, as specified by * <code>ProjectionExpression</code>. * </p> * * @param item * A map of attribute names to <code>AttributeValue</code> objects, as specified by * <code>ProjectionExpression</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public GetItemResult withItem(java.util.Map<String, AttributeValue> item) { setItem(item); return this; }
when(mockAmazonDynamoDBClient.getItem(isA(GetItemRequest.class))).thenAnswer(new Answer<GetItemResult>() { @Override public GetItemResult answer(InvocationOnMock invocation) throws Throwable { GetItemResult result = new GetItemResult(); result.setItem( testResultItem ); return result; } });
public GetItemResult getItem(GetItemRequest request, IsolationLevel isolationLevel) { if (request.getAttributesToGet() != null) { Set<String> attributesToGet = new HashSet<String>(request.getAttributesToGet()); attributesToGet.addAll(Transaction.SPECIAL_ATTR_NAMES); request.setAttributesToGet(attributesToGet); } GetItemResult result = getClient().getItem(request); Map<String, AttributeValue> item = getReadIsolationHandler(isolationLevel).handleItem(result.getItem(), request.getAttributesToGet(), request.getTableName()); Transaction.stripSpecialAttributes(item); result.setItem(item); return result; }
if (context.testExpression("Item", targetDepth)) { context.nextToken(); getItemResult.setItem(new MapUnmarshaller<String, AttributeValue>(context.getUnmarshaller(String.class), AttributeValueJsonUnmarshaller .getInstance()).unmarshall(context));