Example usage for com.amazonaws.services.dynamodbv2.model AttributeValueUpdate setValue

List of usage examples for com.amazonaws.services.dynamodbv2.model AttributeValueUpdate setValue

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.model AttributeValueUpdate setValue.

Prototype


public void setValue(AttributeValue value) 

Source Link

Document

Represents the data for an attribute.

Usage

From source file:org.wildfly.camel.test.common.aws.DynamoDBUtils.java

License:Apache License

public static void updItem(CamelContext camelctx, String title) {

    HashMap<String, AttributeValue> key = new HashMap<>();
    key.put("Id", new AttributeValue().withN("103"));

    HashMap<String, AttributeValueUpdate> updItem = new HashMap<>();
    AttributeValueUpdate updValue = new AttributeValueUpdate();
    updValue.setValue(new AttributeValue().withS(title));
    updItem.put("Title", updValue);

    Exchange exchange = new ExchangeBuilder(camelctx)
            .withHeader(DdbConstants.OPERATION, DdbOperations.UpdateItem).withHeader(DdbConstants.KEY, key)
            .withHeader(DdbConstants.UPDATE_VALUES, updItem).build();

    ProducerTemplate producer = camelctx.createProducerTemplate();
    producer.send("direct:start", exchange);
    Assert.assertNull(exchange.getException());
}