List of usage examples for com.amazonaws.services.dynamodbv2.document PrimaryKey PrimaryKey
public PrimaryKey(KeyAttribute... components)
From source file:jp.classmethod.aws.dynamodb.DynamoDbRepository.java
License:Open Source License
private PrimaryKey getPrimaryKeyFromItem(Item item) { KeyAttribute[] keyAttributes = schemata.stream().map(keySchemaElement -> { final String attrName = keySchemaElement.getAttributeName(); Preconditions.checkArgument(item.hasAttribute(attrName), "must provide keys with " + attrName + " field set"); return new KeyAttribute(attrName, item.get(attrName)); }).toArray(KeyAttribute[]::new); return new PrimaryKey(keyAttributes); }