Example usage for com.amazonaws.services.dynamodbv2.document PrimaryKey PrimaryKey

List of usage examples for com.amazonaws.services.dynamodbv2.document PrimaryKey PrimaryKey

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.document PrimaryKey PrimaryKey.

Prototype

public PrimaryKey(KeyAttribute... components) 

Source Link

Document

Constructs with the specified key components.

Usage

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);
}