/** * <p> * Represents the data for an attribute. * </p> * <p> * Each attribute value is described as a name-value pair. The name is the data type, and the value is the data * itself. * </p> * <p> * For more information, see <a href= * "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes" * >Data Types</a> in the <i>Amazon DynamoDB Developer Guide</i>. * </p> * * @param value * Represents the data for an attribute.</p> * <p> * Each attribute value is described as a name-value pair. The name is the data type, and the value is the * data itself. * </p> * <p> * For more information, see <a href= * "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes" * >Data Types</a> in the <i>Amazon DynamoDB Developer Guide</i>. * @return Returns a reference to this object so that method calls can be chained together. */ public AttributeValueUpdate withValue(AttributeValue value) { setValue(value); return this; }
setValue(value); setAction(action);
setValue(value); setAction(action.toString());
if (context.testExpression("Value", targetDepth)) { context.nextToken(); attributeValueUpdate.setValue(AttributeValueJsonUnmarshaller.getInstance().unmarshall(context));
setValue(value); setAction(action);
/** * Converts a {@link DynamoDBEntry} to {@link AttributeValueUpdate}. * * @return {@link AttributeValueUpdate}. */ public AttributeValueUpdate convertToAttributeUpdateValue() { final AttributeValue attributeValue = this.convertToAttributeValue(); final AttributeValueUpdate attributeUpdate = new AttributeValueUpdate(); if (attributeValue == null) { attributeUpdate.setAction(AttributeAction.DELETE); } else { attributeUpdate.setAction(AttributeAction.PUT); attributeUpdate.setValue(attributeValue); } return attributeUpdate; }
setValue(value); setAction(action.toString());
public AttributeValueUpdate unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } AttributeValueUpdate attributeValueUpdate = new AttributeValueUpdate(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Value")) { attributeValueUpdate.setValue(AttributeValueJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Action")) { attributeValueUpdate.setAction(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return attributeValueUpdate; }
/** * <p> * Represents the data for an attribute. * </p> * <p> * Each attribute value is described as a name-value pair. The name is the data type, and the value is the data * itself. * </p> * <p> * For more information, see <a href= * "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes" * >Data Types</a> in the <i>Amazon DynamoDB Developer Guide</i>. * </p> * * @param value * Represents the data for an attribute.</p> * <p> * Each attribute value is described as a name-value pair. The name is the data type, and the value is the * data itself. * </p> * <p> * For more information, see <a href= * "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes" * >Data Types</a> in the <i>Amazon DynamoDB Developer Guide</i>. * @return Returns a reference to this object so that method calls can be chained together. */ public AttributeValueUpdate withValue(AttributeValue value) { setValue(value); return this; }
setValue(value); setAction(action);
setValue(value); setAction(action.toString());
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()); }
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()); }
if (context.testExpression("Value", targetDepth)) { context.nextToken(); attributeValueUpdate.setValue(AttributeValueJsonUnmarshaller.getInstance().unmarshall(context));