Example usage for com.amazonaws.services.dynamodbv2.document.spec UpdateItemSpec addAttributeUpdate

List of usage examples for com.amazonaws.services.dynamodbv2.document.spec UpdateItemSpec addAttributeUpdate

Introduction

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

Prototype

public UpdateItemSpec addAttributeUpdate(AttributeUpdate attributeUpdate) 

Source Link

Usage

From source file:com.exorath.service.party.service.DynamoDatabaseProvider.java

License:Apache License

/**
 * Get an update item spec for the given party argument
 * This does not call the update, just returns an object that can be used to update the party
 *
 * @param party Generate the update spec based on this party
 * @return Update spec with all the information to update the party
 *///from   w  w  w. ja  v a2  s.c  o m
private UpdateItemSpec getUpdateItemSpec(Party party) {
    UpdateItemSpec update = new UpdateItemSpec();
    update.withPrimaryKey(new KeyAttribute(PARTY_UUID, party.getPartyUuid()));
    //update.addAttributeUpdate(new AttributeUpdate(PARTY_UUID).put(party.getPartyUuid()));
    update.addAttributeUpdate(new AttributeUpdate(OWNER_UUID).put(party.getOwnerUuid()));
    update.addAttributeUpdate(new AttributeUpdate(SERVER_ID).put(party.getServerId()));
    update.addAttributeUpdate(new AttributeUpdate(MEMBERS).put(party.getMembers()));
    update.addAttributeUpdate(new AttributeUpdate(EXPIRE).put(party.getExpiry()));
    return update;
}