/** * Converts a list of <code>AttributeUpdate</code> into the low-level * representation; or null if the input is null. */ public static Map<String, AttributeValueUpdate> toAttributeValueUpdate( List<AttributeUpdate> attributesToUpdate) { if (attributesToUpdate == null) return null; Map<String, AttributeValueUpdate> result = new LinkedHashMap<String, AttributeValueUpdate>(); for (AttributeUpdate attribute : attributesToUpdate) { AttributeValueUpdate attributeToUpdate = new AttributeValueUpdate() .withAction(attribute.getAction()); if (attribute.getValue() != null) { attributeToUpdate.withValue(toAttributeValue(attribute .getValue())); } else if (attribute.getAttributeValues() != null) { attributeToUpdate.withValue(toAttributeValue(attribute .getAttributeValues())); } result.put(attribute.getAttributeName(), attributeToUpdate); } return result; }
/** * Converts a list of <code>AttributeUpdate</code> into the low-level * representation; or null if the input is null. */ public static Map<String, AttributeValueUpdate> toAttributeValueUpdate( List<AttributeUpdate> attributesToUpdate) { if (attributesToUpdate == null) return null; Map<String, AttributeValueUpdate> result = new LinkedHashMap<String, AttributeValueUpdate>(); for (AttributeUpdate attribute : attributesToUpdate) { AttributeValueUpdate attributeToUpdate = new AttributeValueUpdate() .withAction(attribute.getAction()); if (attribute.getValue() != null) { attributeToUpdate.withValue(toAttributeValue(attribute .getValue())); } else if (attribute.getAttributeValues() != null) { attributeToUpdate.withValue(toAttributeValue(attribute .getAttributeValues())); } result.put(attribute.getAttributeName(), attributeToUpdate); } return result; }