/** * When a projection expression is specified, the corresponding name-map can * optionally be specified via { {@link #withNameMap(Map)}. (Note * attributes-to-get must not be specified if a projection expression has * been specified.) */ public GetItemSpec withProjectionExpression(String projectionExpression) { getRequest().setProjectionExpression(projectionExpression); return this; }
public GetItemSpec withAttributesToGet(String ... attrNames) { if (attrNames == null) getRequest().setAttributesToGet(null); else getRequest().setAttributesToGet(Arrays.asList(attrNames)); return this; }
public List<String> getAttributesToGet() { return getRequest().getAttributesToGet(); }
public GetItemSpec withConsistentRead(boolean consistentRead) { getRequest().setConsistentRead(consistentRead); return this; }
public GetItemSpec withReturnConsumedCapacity(ReturnConsumedCapacity capacity) { getRequest().setReturnConsumedCapacity(capacity); return this; }
public String getProjectionExpression() { return getRequest().getProjectionExpression(); }
public Boolean isConsistentRead() { return getRequest().isConsistentRead(); }
public String getReturnConsumedCapacity() { return getRequest().getReturnConsumedCapacity(); }
private GetItemOutcome doLoadItem(GetItemSpec spec) { String tableName = getTable().getTableName(); // Set up the key attributes GetItemRequest req = spec.getRequest() .withTableName(tableName) .withKey(InternalUtils.toAttributeValueMap(spec.getKeyComponents())) .withExpressionAttributeNames(spec.getNameMap()); GetItemResult result = getClient().getItem(req); return new GetItemOutcome(result); }
/** * When a projection expression is specified, the corresponding name-map can * optionally be specified via { {@link #withNameMap(Map)}. (Note * attributes-to-get must not be specified if a projection expression has * been specified.) */ public GetItemSpec withProjectionExpression(String projectionExpression) { getRequest().setProjectionExpression(projectionExpression); return this; }
public GetItemSpec withAttributesToGet(String ... attrNames) { if (attrNames == null) getRequest().setAttributesToGet(null); else getRequest().setAttributesToGet(Arrays.asList(attrNames)); return this; }
public GetItemSpec withReturnConsumedCapacity(ReturnConsumedCapacity capacity) { getRequest().setReturnConsumedCapacity(capacity); return this; }
public GetItemSpec withConsistentRead(boolean consistentRead) { getRequest().setConsistentRead(consistentRead); return this; }
public Boolean isConsistentRead() { return getRequest().isConsistentRead(); }
public String getReturnConsumedCapacity() { return getRequest().getReturnConsumedCapacity(); }
public List<String> getAttributesToGet() { return getRequest().getAttributesToGet(); }
public String getProjectionExpression() { return getRequest().getProjectionExpression(); }
private GetItemOutcome doLoadItem(GetItemSpec spec) { String tableName = getTable().getTableName(); // Set up the key attributes GetItemRequest req = spec.getRequest() .withTableName(tableName) .withKey(InternalUtils.toAttributeValueMap(spec.getKeyComponents())) .withExpressionAttributeNames(spec.getNameMap()); GetItemResult result = getClient().getItem(req); return new GetItemOutcome(result); }